Update providers

This commit is contained in:
Ankit Mahato
2023-04-13 10:53:48 +05:30
parent d4b707a212
commit 6db7f37211
11 changed files with 93 additions and 115 deletions

View File

@ -45,7 +45,7 @@ class App extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final theme = ref.watch(themeStateProvider);
final isDarkMode = ref.watch(darkModeProvider);
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
@ -60,11 +60,7 @@ class App extends ConsumerWidget {
useMaterial3: true,
brightness: Brightness.dark,
),
themeMode: theme != null
? theme
? ThemeMode.light
: ThemeMode.dark
: ThemeMode.system,
themeMode: isDarkMode ? ThemeMode.dark : ThemeMode.light,
home: const HomePage(),
);
}