diff --git a/lib/screens/tabs.dart b/lib/screens/tabs.dart index 92abe96..1b22a8c 100644 --- a/lib/screens/tabs.dart +++ b/lib/screens/tabs.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_navigation/screens/categories.dart'; import 'package:flutter_navigation/screens/meals.dart'; +import 'package:flutter_navigation/widgets/main_drawer.dart'; import '../models/meal.dart'; @@ -63,6 +64,7 @@ class _TabsScreenState extends State { appBar: AppBar( title: Text(activePageTitle), ), + drawer: const MainDrawer(), body: activePage, bottomNavigationBar: BottomNavigationBar( onTap: _selectPage, diff --git a/lib/widgets/main_drawer.dart b/lib/widgets/main_drawer.dart new file mode 100644 index 0000000..a1917e4 --- /dev/null +++ b/lib/widgets/main_drawer.dart @@ -0,0 +1,77 @@ +import 'package:flutter/material.dart'; + +class MainDrawer extends StatelessWidget { + const MainDrawer({super.key}); + + @override + Widget build(BuildContext context) { + return Drawer( + child: Column( + children: [ + DrawerHeader( + padding: const EdgeInsets.all(20), + decoration: BoxDecoration( + gradient: LinearGradient( + colors: [ + Theme.of(context).colorScheme.primaryContainer, + Theme.of(context) + .colorScheme + .primaryContainer + .withOpacity(0.8), + ], + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ), + ), + child: Row( + children: [ + Icon( + Icons.fastfood, + size: 48, + color: Theme.of(context).colorScheme.primary, + ), + const SizedBox(width: 18), + Text( + 'Cooking Up!', + style: Theme.of(context).textTheme.titleLarge!.copyWith( + color: Theme.of(context).colorScheme.primary, + ), + ) + ], + ), + ), + ListTile( + leading: Icon( + Icons.restaurant, + size: 26, + color: Theme.of(context).colorScheme.onBackground, + ), + title: Text( + 'Meals', + style: Theme.of(context).textTheme.titleSmall!.copyWith( + color: Theme.of(context).colorScheme.onBackground, + fontSize: 24, + ), + ), + onTap: () {}, + ), + ListTile( + leading: Icon( + Icons.settings, + size: 26, + color: Theme.of(context).colorScheme.onBackground, + ), + title: Text( + 'Filters', + style: Theme.of(context).textTheme.titleSmall!.copyWith( + color: Theme.of(context).colorScheme.onBackground, + fontSize: 24, + ), + ), + onTap: () {}, + ), + ], + ), + ); + } +}