kece abis
This commit is contained in:
parent
7dc3352636
commit
2d2c8c0cab
|
|
@ -103,7 +103,6 @@ class EvaporasiChartWidget extends StatelessWidget {
|
|||
}
|
||||
|
||||
// Hitung range masing-masing agar axis kanan (°C) masuk akal.
|
||||
final evapMinRaw = _minOf(dailyValues);
|
||||
final evapMaxRaw = _maxOf(dailyValues);
|
||||
final tempMinRaw = _minOf(dailyTemperatures);
|
||||
final tempMaxRaw = _maxOf(dailyTemperatures);
|
||||
|
|
|
|||
|
|
@ -21,6 +21,9 @@ class _EvaporasiDateSearchBarState extends State<EvaporasiDateSearchBar> {
|
|||
void initState() {
|
||||
super.initState();
|
||||
_controller = TextEditingController(text: widget.initialQuery);
|
||||
_controller.addListener(() {
|
||||
setState(() {});
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
@ -39,7 +42,10 @@ class _EvaporasiDateSearchBarState extends State<EvaporasiDateSearchBar> {
|
|||
suffixIcon: _controller.text.isNotEmpty
|
||||
? IconButton(
|
||||
icon: const Icon(Icons.clear),
|
||||
onPressed: () => setState(() => _controller.clear()),
|
||||
onPressed: () {
|
||||
_controller.clear();
|
||||
widget.onQueryChanged('');
|
||||
},
|
||||
)
|
||||
: null,
|
||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12)),
|
||||
|
|
@ -47,7 +53,6 @@ class _EvaporasiDateSearchBarState extends State<EvaporasiDateSearchBar> {
|
|||
),
|
||||
onChanged: (v) {
|
||||
widget.onQueryChanged(v);
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,6 +83,17 @@ class Evaporasi {
|
|||
json['tinggiAir_m'],
|
||||
);
|
||||
|
||||
// =========================
|
||||
// FILTER DATA INVALID
|
||||
// =========================
|
||||
|
||||
// evaporasi normal 0-50 mm
|
||||
final evaporasiFiltered = (evaporasiVal < 0 || evaporasiVal > 50)
|
||||
? 0.0
|
||||
: evaporasiVal;
|
||||
|
||||
final tinggiFiltered = (tinggiVal < 0 || tinggiVal > 100) ? 0.0 : tinggiVal;
|
||||
|
||||
// Default timestamp: fallback now (kalau field waktu tidak ada).
|
||||
// Catatan: untuk Firebase seharusnya timestamp dikirim konsisten (ms atau ISO string).
|
||||
DateTime timestamp = DateTime.now();
|
||||
|
|
@ -134,12 +145,6 @@ class Evaporasi {
|
|||
}
|
||||
}
|
||||
|
||||
final evaporasiFiltered = (evaporasiVal < 0 || evaporasiVal > 50)
|
||||
? 0.0
|
||||
: evaporasiVal;
|
||||
|
||||
final tinggiFiltered = (tinggiVal < 0 || tinggiVal > 100) ? 0.0 : tinggiVal;
|
||||
|
||||
return Evaporasi(
|
||||
evaporasi: evaporasiFiltered,
|
||||
suhu: suhuVal,
|
||||
|
|
|
|||
Loading…
Reference in New Issue