diff options
Diffstat (limited to 'lib/screens')
-rw-r--r-- | lib/screens/chat_screen.dart | 8 | ||||
-rw-r--r-- | lib/screens/dashboard_screen.dart | 39 |
2 files changed, 27 insertions, 20 deletions
diff --git a/lib/screens/chat_screen.dart b/lib/screens/chat_screen.dart index 64f8621..b815a6a 100644 --- a/lib/screens/chat_screen.dart +++ b/lib/screens/chat_screen.dart @@ -1,4 +1,5 @@ import 'package:firebase_auth/firebase_auth.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:linkchat/firebase/auth.dart'; import 'package:linkchat/firebase/database.dart'; @@ -43,11 +44,6 @@ class _ChatScreenState extends State<ChatScreen> { leadingWidth: 30, title: Row( children: [ - // ClipRRect( - // borderRadius: BorderRadius.circular(30), - // child: CircleAvatar( - // backgroundImage: NetworkImage(user!.photoUrl), - // )), CachedAvatar(user?.photoUrl), Padding( padding: const EdgeInsets.only(left: 10), @@ -119,7 +115,7 @@ class _ChatScreenState extends State<ChatScreen> { }), ); } else if (snapshot.hasError) { - print('Error: ${snapshot.error}'); + if (kDebugMode) print('Error: ${snapshot.error}'); return const Center(child: Text('Hubo un error')); } return const Center(child: CircularProgressIndicator()); 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; }), ), |