-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored and added drawer for mobile navigation
- Loading branch information
1 parent
0515add
commit 9da0b9d
Showing
3 changed files
with
83 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
List<TextButton> navigationActions = [ | ||
// home | ||
TextButton.icon( | ||
onPressed: () {}, | ||
icon: const Icon(Icons.home_rounded), | ||
label: const Text('Home'), | ||
), | ||
// register | ||
TextButton.icon( | ||
onPressed: () {}, | ||
icon: const Icon(Icons.person_add_rounded), | ||
label: const Text('Register'), | ||
), | ||
// login | ||
TextButton.icon( | ||
onPressed: () {}, | ||
icon: const Icon(Icons.login_rounded), | ||
label: const Text('Login'), | ||
), | ||
// cart | ||
TextButton.icon( | ||
onPressed: () {}, | ||
icon: const Icon(Icons.shopping_cart_rounded), | ||
label: const Text('Cart'), | ||
), | ||
// contact | ||
TextButton.icon( | ||
onPressed: () {}, | ||
icon: const Icon(Icons.contact_page_rounded), | ||
label: const Text('Contact'), | ||
), | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
lib/widgets/custom_navigation_drawer/custom_navigation_drawer.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import '../custom_navigation_bar/navigation_actions.dart'; | ||
import '../custom_navigation_bar/navigation_bar_logo.dart'; | ||
|
||
class CustomNavigationDrawer extends StatelessWidget { | ||
const CustomNavigationDrawer({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return SizedBox( | ||
width: 210, | ||
height: MediaQuery.of(context).size.height, | ||
child: Container( | ||
decoration: const BoxDecoration( | ||
color: Colors.white, | ||
boxShadow: [ | ||
BoxShadow( | ||
color: Colors.black12, | ||
blurRadius: 18, | ||
), | ||
], | ||
), | ||
padding: const EdgeInsets.symmetric(horizontal: 18), | ||
child: Column( | ||
mainAxisSize: MainAxisSize.max, | ||
mainAxisAlignment: MainAxisAlignment.start, | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
const Padding( | ||
padding: EdgeInsets.symmetric(vertical: 30), | ||
child: NavigationBarLogo(), | ||
), | ||
...navigationActions | ||
.map( | ||
(action) => Padding( | ||
padding: const EdgeInsets.symmetric(vertical: 10), | ||
child: action, | ||
), | ||
) | ||
.toList(), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |