Skip to content

Commit

Permalink
cleaning and improving the design of the drawer native UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Syipmong committed Feb 14, 2024
1 parent 0a2388f commit 80d3282
Showing 1 changed file with 48 additions and 17 deletions.
65 changes: 48 additions & 17 deletions lib/screens/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,38 +27,69 @@ class _HomeScreenState extends State<HomeScreen> {
drawer: Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: <Widget>[
children: [
const DrawerHeader(
padding: EdgeInsets.zero,
decoration: BoxDecoration(
color: Colors.blue,
color: Colors.deepPurple,
),
child: UserAccountsDrawerHeader(
otherAccountsPictures: [
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CircleAvatar(
child: FlutterLogo(size: 42.0),
radius: 30,
backgroundImage: AssetImage('assets/images/avatar.png'),
),
CircleAvatar(
child: FlutterLogo(size: 42.0),
),
SizedBox(height: 10),
Text(
'John Doe',
style: TextStyle(
color: Colors.white,
fontSize: 20,
),
),
Text(
"email@flutter.com"
),
],
currentAccountPicture: CircleAvatar(
child: FlutterLogo(size: 42.0),
),
margin: EdgeInsets.zero,
accountName: Text("John Doe"),
accountEmail: Text('User@gmail.com'),
),
),
ListTile(
title: const Text('Item 1'),
leading: const Icon(Icons.home),
title: const Text('Home'),
onTap: () {
// Navigate to home screen
Navigator.pop(context);
},
),
ListTile(
leading: const Icon(Icons.person),
title: const Text('Profile'),
onTap: () {
// Navigate to profile screen
Navigator.pop(context);
},
),
ListTile(
leading: const Icon(Icons.settings),
title: const Text('Settings'),
onTap: () {
// Navigate to settings screen
Navigator.pop(context);
},
),
ListTile(
leading: const Icon(Icons.info),
title: const Text('About'),
onTap: () {
// Navigate to about screen
Navigator.pop(context);
},
),
const Divider(),
ListTile(
title: const Text('Item 2'),
title: const Text('Log out'),
onTap: () {
// Log out logic
Navigator.pop(context);
},
),
Expand Down

0 comments on commit 80d3282

Please sign in to comment.