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:
2026-04-26 12:00:14 +10:00
parent 33d1713f51
commit 59597c7a4f
12 changed files with 337 additions and 22 deletions
+44
View File
@@ -0,0 +1,44 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'core/providers/settings_provider.dart';
import 'features/log_mood/log_mood_screen.dart';
class App extends ConsumerWidget {
const App({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
final onboardingAsync = ref.watch(isOnboardingCompleteProvider);
return MaterialApp(
title: 'DailyYou',
debugShowCheckedModeBanner: false,
theme: _lightTheme(),
darkTheme: _darkTheme(),
themeMode: ThemeMode.system,
home: onboardingAsync.when(
data: (complete) => const LogMoodScreen(),
loading: () => const Scaffold(
body: Center(child: CircularProgressIndicator()),
),
error: (e, _) => const LogMoodScreen(),
),
);
}
ThemeData _lightTheme() => ThemeData(
useMaterial3: true,
colorScheme: ColorScheme.fromSeed(
seedColor: const Color(0xFF6B8CFF),
brightness: Brightness.light,
),
);
ThemeData _darkTheme() => ThemeData(
useMaterial3: true,
colorScheme: ColorScheme.fromSeed(
seedColor: const Color(0xFF6B8CFF),
brightness: Brightness.dark,
),
);
}