diff --git a/TODO.md b/TODO.md
index 0ea3373..238b31f 100644
--- a/TODO.md
+++ b/TODO.md
@@ -1,10 +1,16 @@
-# TODO
+# TODO - Fix flutter analyze issues
-- [ ] Plan & identifikasi penyebab garis merah pada `evaporasi_chart_widget.dart`.
-- [ ] Periksa isi file `evaporasi_chart_widget.dart` untuk potensi error sintaks/typing.
-- [ ] Lakukan perbaikan kode sesuai penyebabnya.
-- [x] Analisis file `evaporasi_chart_widget.dart` untuk potensi error sintaks/typing yang memicu garis merah.
-- [x] Perbaiki penyebab garis merah pada `evaporasi_chart_widget.dart` (syntax/indentation/typing).
-- [ ] Jalankan `flutter format` dan `flutter analyze` (manual di terminal) untuk memastikan error hilang.
+## Step 1: Fix evaporasi.dart parse conflict
+- Remove leftover git conflict markers in packages/monitoring_repository/lib/src/models/evaporasi.dart
+- Unify timestamp parsing logic into a single implementation
+- Ensure `factory Evaporasi.fromJson` always returns a non-null `Evaporasi`
+## Step 2: Fix Google Sign-In import errors
+- Investigate why `package:google_sign_in/google_sign_in.dart` is reported missing
+- Update user_repository dependency versions if needed
+- Run `flutter pub get` (from c:/flutter/klimatologi) and `flutter analyze` again
+
+## Step 3: Re-run analyze and address remaining warnings
+- Run `flutter analyze` and fix any remaining compile errors
+- Optionally clean up performance/deprecation warnings (const constructors, withOpacity deprecation, Share->SharePlus)
diff --git a/analyze_output.txt b/analyze_output.txt
new file mode 100644
index 0000000..2dead12
Binary files /dev/null and b/analyze_output.txt differ
diff --git a/blackboxai_plan.md b/blackboxai_plan.md
new file mode 100644
index 0000000..d52d913
--- /dev/null
+++ b/blackboxai_plan.md
@@ -0,0 +1,48 @@
+# Edit plan (approved before edits)
+
+## Information gathered
+- `flutter analyze` reports many issues, but the compile-stopping ones are:
+ 1) `packages/monitoring_repository/lib/src/models/evaporasi.dart` contains unresolved git merge conflict markers (`<<<<<<< HEAD`, `=======`, `>>>>>>> ...`) and thus causes syntax errors and incorrect factory return type/assignments.
+ 2) `packages/user_repository/lib/src/firebase_user_repo.dart` cannot resolve `package:google_sign_in/google_sign_in.dart` and related symbols (`GoogleSignIn`, `GoogleSignInAuthentication`).
+- Read `evaporasi.dart`: conflict markers exist inside `Evaporasi.fromJson`, causing broken code.
+- Read `firebase_user_repo.dart`: it imports `package:google_sign_in/google_sign_in.dart` and uses `GoogleSignIn`, `GoogleSignInAuthentication`.
+- Read `packages/monitoring_repository/pubspec.yaml`: no `google_sign_in` dependency there (likely only in user_repository).
+- Read `packages/user_repository/pubspec.yaml`: `google_sign_in: ^6.3.0` is present.
+- `search_files` for conflict markers returned none (likely because pattern needs exact marker search or repo search mismatch), but reading the file shows markers are present.
+
+## Plan
+### Step A — Fix evaporasi.dart merge conflict
+- Edit `packages/monitoring_repository/lib/src/models/evaporasi.dart`:
+ - Remove all `<<<<<<< HEAD`, `=======`, `>>>>>>> ...` markers.
+ - Consolidate timestamp parsing:
+ - Keep a robust `parseTimestamp(dynamic raw)` helper.
+ - Use one `rawTimestamp` priority order: `json['timestamp'] ?? json['time'] ?? json['datetime']`.
+ - Keep legacy fallback from `json['waktu']` (HH:mm:ss) if other timestamp fields are missing.
+ - Keep filtering for evaporasi (0..50) and tinggiAir (0..100) and sensor sanity for suhu (-50..100).
+ - Ensure `factory Evaporasi.fromJson(...)` always returns an `Evaporasi` with a non-null `timestamp`.
+
+### Step B — Fix google_sign_in missing import/class errors
+Because `google_sign_in` is declared but analyzer can't find the Dart library:
+- Check whether the dependency actually downloaded/available. The simplest fix path is:
+ - Run `flutter pub get` correctly (Windows shell issue is present: `&&` is not valid in the terminal context).
+ - Re-run `flutter analyze` to see if the missing import resolves.
+- If still failing:
+ - Inspect `packages/user_repository/pubspec.lock` / ensure plugin supports current platform (and that the package name/dart import matches).
+ - Update `google_sign_in` version to a compatible one if necessary.
+
+### Step C — Re-run analyze
+- After Step A and Step B, run `flutter analyze` again and fix any remaining compile errors.
+
+## Dependent files to edit
+- `packages/monitoring_repository/lib/src/models/evaporasi.dart`
+- Potentially `packages/user_repository/pubspec.yaml` (only if dependency resolution still fails)
+
+## Followup steps
+- Run `flutter pub get` (from `c:/flutter/klimatologi`).
+- Run `flutter analyze` again.
+- If compile succeeds, optionally address warnings (prefer_const_constructors, deprecated withOpacity, Share -> SharePlus, etc.).
+
+
+Approve Step A (remove merge conflict and fix timestamp parsing in evaporasi.dart). After that I will proceed to Step B (google_sign_in resolution) based on the next analyze output.
+
+
diff --git a/lib/screens/monitoring/evaporasi/blocs/evaporasi_bloc.dart b/lib/screens/monitoring/evaporasi/blocs/evaporasi_bloc.dart
index 97ef996..fab84c6 100644
--- a/lib/screens/monitoring/evaporasi/blocs/evaporasi_bloc.dart
+++ b/lib/screens/monitoring/evaporasi/blocs/evaporasi_bloc.dart
@@ -1,10 +1,11 @@
import 'dart:async';
+
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:monitoring_repository/monitoring_repository.dart';
-import '../../../../core/utils/time_series_mapper.dart';
import '../../../../blocs/notification_bloc/notification_bloc.dart';
+import '../../../../core/utils/time_series_mapper.dart';
part 'evaporasi_event.dart';
part 'evaporasi_state.dart';
@@ -33,14 +34,16 @@ class EvaporasiBloc extends Bloc {
) async {
emit(state.copyWith(isLoading: true));
- final history = await _repository.getSensorHistory(
- 'Monitoring/History',
- (json) => Evaporasi.fromJson(json),
- );
-
- final listData = List.from(history)
+ final history = List.from(
+ await _repository.getSensorHistory(
+ 'Monitoring/History',
+ (json) => Evaporasi.fromJson(json),
+ ),
+ )
..sort((a, b) => a.timestamp.compareTo(b.timestamp));
+ final listData = List.from(history);
+
final dailyGraph = TimeSeriesMapper.toDaily(
data: history,
getTime: (e) => e.timestamp,
@@ -80,11 +83,13 @@ class EvaporasiBloc extends Bloc {
final lastValue = history.isNotEmpty ? history.last.evaporasi : 0.0;
final lastWaterLevel = history.isNotEmpty ? history.last.tinggiAir : 0.0;
final lastTemperature = history.isNotEmpty ? history.last.suhu : 0.0;
+
final (status, rain) = _computeWeatherStatus(lastValue);
_emitEvaporasiAlert(status, rain, lastValue);
emit(state.copyWith(
history: history,
+ listData: listData,
currentValue: lastValue,
waterLevel: lastWaterLevel,
temperature: lastTemperature,
@@ -97,33 +102,53 @@ class EvaporasiBloc extends Bloc {
chartLabels: _buildChartLabels(period: 'Hari Ini'),
weatherStatus: status,
willRain: rain,
- listData: listData,
+ currentData: history.isNotEmpty ? history.last : null,
+ viewMode: EvaporasiViewMode.period,
+ selectedDate: null,
isLoading: false,
));
await _subscription?.cancel();
_subscription = _repository
- .getSensorStream('Monitoring', (json) => Evaporasi.fromJson(json))
+ .getSensorStream('Monitoring/History', _latestHistoryEntry)
.listen((data) => add(_EvaporasiRealtimeUpdated(data)));
}
+ Evaporasi _latestHistoryEntry(Map json) {
+ if (json.isEmpty) return Evaporasi.empty;
+
+ final entries = json.values
+ .whereType