diff options
author | Iván Ávalos <avalos@disroot.org> | 2023-05-27 13:14:45 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2023-05-27 13:25:24 -0600 |
commit | a88ccf31b59541faea8c38c638737c1359cfff47 (patch) | |
tree | 30acf22e4df0bfa41b34e40b223521fbef5a4730 /lib/screens/dashboard_screen.dart | |
parent | d0d54a9d6e7ac947ae86962b6bbc7eeb9ada5011 (diff) | |
download | linkchat-a88ccf31b59541faea8c38c638737c1359cfff47.tar.gz linkchat-a88ccf31b59541faea8c38c638737c1359cfff47.tar.bz2 linkchat-a88ccf31b59541faea8c38c638737c1359cfff47.zip |
Se implementan colores dinámicos (Android 13)
Diffstat (limited to 'lib/screens/dashboard_screen.dart')
-rw-r--r-- | lib/screens/dashboard_screen.dart | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 4905b84..be3aca0 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -51,29 +51,40 @@ class _DashboardScreenState extends State<DashboardScreen> { children: [ UserAccountsDrawerHeader( currentAccountPicture: CachedAvatar(_auth.currentUser?.photoURL), - accountName: Text(_auth.currentUser?.displayName ?? "Lincite"), + accountName: Text( + _auth.currentUser?.displayName ?? "Lincite", + style: TextStyle( + color: Theme.of(context).colorScheme.onPrimary, + ), + ), accountEmail: _auth.currentUser?.email != null - ? Text(_auth.currentUser!.email!) + ? Text( + _auth.currentUser!.email!, + style: TextStyle( + color: Theme.of(context).colorScheme.onPrimary, + ), + ) : null, ), ListTile( title: const Text('Tema'), - trailing: SegmentedButton<ThemeData?>( - segments: [ - const ButtonSegment<ThemeData?>( - value: null, + trailing: SegmentedButton<ThemeEnum>( + segments: const [ + ButtonSegment<ThemeEnum>( + value: ThemeEnum.auto, icon: Icon(Icons.brightness_auto), ), - ButtonSegment<ThemeData?>( - value: ThemeSettings.lightTheme, - icon: const Icon(Icons.light_mode), + ButtonSegment<ThemeEnum>( + value: ThemeEnum.light, + icon: Icon(Icons.light_mode), + ), + ButtonSegment<ThemeEnum>( + value: ThemeEnum.dark, + icon: Icon(Icons.dark_mode), ), - ButtonSegment<ThemeData?>( - value: ThemeSettings.darkTheme, - icon: const Icon(Icons.dark_mode)), ], - selected: <ThemeData?>{themeProvider.theme}, - onSelectionChanged: ((Set<ThemeData?> newSelection) { + selected: <ThemeEnum>{themeProvider.theme}, + onSelectionChanged: ((Set<ThemeEnum> newSelection) { themeProvider.theme = newSelection.first; }), ), |