feat: wire up app shell, log mood screen, and fix Android build
- Bootstrap ProviderScope in main.dart and move App to app.dart with light/dark theming - Add initial LogMoodScreen with mood entry flow and shared activity/mood widgets - Add kIsWeb guard in app_database.dart for drift web support - Enable Android core library desugaring required by flutter_local_notifications 21.x - Guard all async notifier state assignments with ref.mounted checks to prevent use-after-dispose errors when providers are auto-disposed mid-operation
This commit is contained in:
@@ -37,6 +37,7 @@ class InsightNotifier extends Notifier<AsyncValue<String?>> {
|
||||
final dao = ref.read(insightDaoProvider);
|
||||
|
||||
final cached = await dao.getCached(hash);
|
||||
if (!ref.mounted) return;
|
||||
if (cached != null) {
|
||||
state = AsyncData(cached.responseText);
|
||||
return;
|
||||
@@ -62,6 +63,7 @@ class InsightNotifier extends Notifier<AsyncValue<String?>> {
|
||||
rangeEnd: Value(rangeEnd),
|
||||
),
|
||||
);
|
||||
if (!ref.mounted) return;
|
||||
state = AsyncData(responseText);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user