oke
This commit is contained in:
parent
85dd04c850
commit
243add9dc3
|
|
@ -23,6 +23,7 @@ const _kAverageOptions = <String, int>{
|
||||||
'30 detik': 30000,
|
'30 detik': 30000,
|
||||||
'1 menit': 60000,
|
'1 menit': 60000,
|
||||||
'5 menit': 300000,
|
'5 menit': 300000,
|
||||||
|
'6 menit': 360000,
|
||||||
'10 menit': 600000,
|
'10 menit': 600000,
|
||||||
'30 menit': 1800000,
|
'30 menit': 1800000,
|
||||||
};
|
};
|
||||||
|
|
@ -31,6 +32,7 @@ const _kAverageOptions = <String, int>{
|
||||||
const _kHistoryOptions = <String, int>{
|
const _kHistoryOptions = <String, int>{
|
||||||
'30 detik': 30000,
|
'30 detik': 30000,
|
||||||
'1 menit': 60000,
|
'1 menit': 60000,
|
||||||
|
'6 menit': 360000,
|
||||||
'10 menit': 600000,
|
'10 menit': 600000,
|
||||||
'30 menit': 1800000,
|
'30 menit': 1800000,
|
||||||
'1 jam': 3600000,
|
'1 jam': 3600000,
|
||||||
|
|
|
||||||
|
|
@ -423,10 +423,10 @@ class WindSpeedBloc extends Bloc<WindSpeedEvent, WindSpeedState> {
|
||||||
|
|
||||||
if (speed >= _kWindDanger) {
|
if (speed >= _kWindDanger) {
|
||||||
severity = AlertSeverity.danger;
|
severity = AlertSeverity.danger;
|
||||||
message = 'Kecepatan angin ${speed.toStringAsFixed(1)} m/s — BAHAYA';
|
message = 'Kecepatan angin ${speed.toStringAsFixed(1)} km/h — BAHAYA';
|
||||||
} else if (speed >= _kWindWarning) {
|
} else if (speed >= _kWindWarning) {
|
||||||
severity = AlertSeverity.warning;
|
severity = AlertSeverity.warning;
|
||||||
message = 'Kecepatan angin ${speed.toStringAsFixed(1)} m/s — waspada';
|
message = 'Kecepatan angin ${speed.toStringAsFixed(1)} km/h — waspada';
|
||||||
} else {
|
} else {
|
||||||
severity = AlertSeverity.info;
|
severity = AlertSeverity.info;
|
||||||
message = '';
|
message = '';
|
||||||
|
|
|
||||||
|
|
@ -758,11 +758,6 @@ class _WindSpeedScreenState extends State<WindSpeedScreen> {
|
||||||
const Text('km/h',
|
const Text('km/h',
|
||||||
style: TextStyle(fontSize: 20, color: Colors.white70)),
|
style: TextStyle(fontSize: 20, color: Colors.white70)),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
Text(
|
|
||||||
'${(speed / 3.6).toStringAsFixed(3)} m/s',
|
|
||||||
style: const TextStyle(fontSize: 14, color: Colors.white54),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 14),
|
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 18, vertical: 7),
|
padding: const EdgeInsets.symmetric(horizontal: 18, vertical: 7),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
class MyWindSpeed {
|
class MyWindSpeed {
|
||||||
final double windwegKm;
|
final double windwegKm;
|
||||||
|
final double speedKmh;
|
||||||
final double totalWindwegKm;
|
final double totalWindwegKm;
|
||||||
final double maxWindwegKm;
|
final double maxWindwegKm;
|
||||||
final int totalPulse;
|
final int totalPulse;
|
||||||
|
|
@ -8,6 +9,7 @@ class MyWindSpeed {
|
||||||
|
|
||||||
MyWindSpeed({
|
MyWindSpeed({
|
||||||
required this.windwegKm,
|
required this.windwegKm,
|
||||||
|
this.speedKmh = 0.0,
|
||||||
this.totalWindwegKm = 0.0,
|
this.totalWindwegKm = 0.0,
|
||||||
this.maxWindwegKm = 0.0,
|
this.maxWindwegKm = 0.0,
|
||||||
this.totalPulse = 0,
|
this.totalPulse = 0,
|
||||||
|
|
@ -16,7 +18,7 @@ class MyWindSpeed {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Getter alias untuk kompatibilitas dengan bloc/chart yang pakai .speed
|
// Getter alias untuk kompatibilitas dengan bloc/chart yang pakai .speed
|
||||||
double get speed => windwegKm;
|
double get speed => speedKmh;
|
||||||
double get maxSpeed => maxWindwegKm;
|
double get maxSpeed => maxWindwegKm;
|
||||||
|
|
||||||
static final empty = MyWindSpeed(
|
static final empty = MyWindSpeed(
|
||||||
|
|
@ -33,6 +35,7 @@ class MyWindSpeed {
|
||||||
json['speed'] ??
|
json['speed'] ??
|
||||||
0))
|
0))
|
||||||
.toDouble(),
|
.toDouble(),
|
||||||
|
speedKmh: (json['speed_kmh'] ?? 0).toDouble(),
|
||||||
totalWindwegKm: (json['total_windweg_km'] ?? 0).toDouble(),
|
totalWindwegKm: (json['total_windweg_km'] ?? 0).toDouble(),
|
||||||
maxWindwegKm: (json['max_windweg_km'] ?? 0).toDouble(),
|
maxWindwegKm: (json['max_windweg_km'] ?? 0).toDouble(),
|
||||||
totalPulse: (json['total_pulse'] ?? 0) as int,
|
totalPulse: (json['total_pulse'] ?? 0) as int,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue