diff options
Diffstat (limited to 'lib/screens/dashboard_screen.dart')
-rw-r--r-- | lib/screens/dashboard_screen.dart | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart new file mode 100644 index 0000000..69e6d00 --- /dev/null +++ b/lib/screens/dashboard_screen.dart @@ -0,0 +1,63 @@ +import 'package:flutter/material.dart'; +import 'package:pmsna1/providers/theme_provider.dart'; +import 'package:pmsna1/settings/themes.dart'; +import 'package:provider/provider.dart'; + +class DashboardScreen extends StatelessWidget { + const DashboardScreen({super.key}); + @override + Widget build(BuildContext context) { + final ThemeProvider themeProvider = context.watch<ThemeProvider>(); + return Scaffold( + body: CustomScrollView( + slivers: [ + SliverAppBar.large( + title: const Text('Inicio'), + ), + ], + ), + drawer: Drawer( + child: ListView( + children: [ + UserAccountsDrawerHeader( + currentAccountPicture: const CircleAvatar( + backgroundImage: + NetworkImage('https://avalos.me/images/pro.jpg'), + ), + accountName: const Text('Iván Ávalos'), + accountEmail: const Text('avalos@disroot.org'), + ), + ListTile( + leading: const Icon(Icons.home), + title: const Text('Inicio'), + onTap: () {}, + ), + const Divider(), + ListTile( + title: const Text('Tema'), + trailing: SegmentedButton<ThemeData?>( + segments: [ + const ButtonSegment<ThemeData?>( + value: null, + icon: Icon(Icons.brightness_auto), + ), + ButtonSegment<ThemeData?>( + value: ThemeSettings.lightTheme, + icon: const Icon(Icons.light_mode), + ), + ButtonSegment<ThemeData?>( + value: ThemeSettings.darkTheme, + icon: const Icon(Icons.dark_mode)), + ], + selected: <ThemeData?>{themeProvider.theme}, + onSelectionChanged: ((Set<ThemeData?> newSelection) { + themeProvider.theme = newSelection.first; + }), + ), + ) + ], + ), + ), + ); + } +} |