diff options
author | Iván Ávalos <avalos@disroot.org> | 2023-03-05 22:09:34 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2023-03-05 22:48:50 -0600 |
commit | 6cf6880787ae7cd52293df048283e0848d43f6c7 (patch) | |
tree | 91f9f2393f3aa370e7cccef82a710863f9350881 /lib/main.dart | |
parent | b57766ceda9c0a097becea7f3bc6c729929b90cb (diff) | |
download | pmsna1-6cf6880787ae7cd52293df048283e0848d43f6c7.tar.gz pmsna1-6cf6880787ae7cd52293df048283e0848d43f6c7.tar.bz2 pmsna1-6cf6880787ae7cd52293df048283e0848d43f6c7.zip |
Save selected theme to shared preferences
Diffstat (limited to 'lib/main.dart')
-rw-r--r-- | lib/main.dart | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/main.dart b/lib/main.dart index 49e59ac..8af7617 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -42,12 +42,9 @@ class PMSNA1 extends StatelessWidget { @override Widget build(BuildContext context) { - final ThemeData? theme = context.watch<ThemeProvider>().theme; - // return MaterialApp( - // theme: theme ?? ThemeSettings.darkTheme, - // routes: getApplicationRoutes(), - // initialRoute: '/login', - // ); + final ThemeProvider provider = context.watch<ThemeProvider>(); + final ThemeData? theme = provider.theme; + provider.syncFromPrefs(); return MaterialApp( theme: theme ?? ThemeSettings.lightTheme, darkTheme: theme ?? ThemeSettings.darkTheme, |