Drawer (App Drawer) Simple UI

 import "package:flutter/material.dart";


void main() {
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({super.key});

@override
Widget build(BuildContext context) {
return MaterialApp(
title: "App Drawer",
debugShowCheckedModeBanner: false,
theme: ThemeData(
appBarTheme: const AppBarTheme(
backgroundColor: Colors.grey,
centerTitle: true,
),
),
home: const AppDrawer(),
);
}
}

class AppDrawer extends StatelessWidget {
const AppDrawer({super.key});

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("App Drawer Demo"),
),
drawer: Drawer(
child: ListView(
padding: EdgeInsets.zero,

/// To remove space at Top position of AssetImage
children: [
const UserAccountsDrawerHeader(
accountName: Text("Jay Hanuman"),
accountEmail: Text("jayhanuman34@gmail.com"),
currentAccountPicture: CircleAvatar(
backgroundImage: AssetImage("assets/images/Lord-Hanuman.jpg"),
),
decoration: BoxDecoration(
color: Colors.grey,
image: DecorationImage(
image: AssetImage("assets/images/Natural_image.jpg"),
fit: BoxFit.cover,
),
),
),
ListTile(
leading: const Icon(Icons.file_upload),
title: const Text("Upload shot"),
onTap: () {
Navigator.pop(context);
},
),
const Divider(),
ListTile(
leading: const Icon(Icons.account_circle),
title: const Text("Profile"),
onTap: () {
Navigator.pop(context);
},
),
const Divider(),
ListTile(
leading: const Icon(Icons.message),
title: const Text("Message"),
onTap: () {
Navigator.pop(context);
},
),
const Divider(),
ListTile(
leading: const Icon(Icons.line_axis),
title: const Text("Stats"),
onTap: () {
Navigator.pop(context);
},
),
const Divider(),
ListTile(
leading: const Icon(Icons.share),
title: const Text("Share"),
onTap: () {
Navigator.pop(context);
},
),
const Divider(),
ListTile(
leading: const Icon(Icons.notifications),
title: const Text("Notifications"),
onTap: () {
Navigator.pop(context);
},
),
const Divider(),
ListTile(
leading: const Icon(Icons.settings),
title: const Text("Settings"),
onTap: () {
Navigator.pop(context);
},
),
const Divider(),
ListTile(
leading: const Icon(Icons.logout),
title: const Text("Sign Out"),
onTap: () {
Navigator.pop(context);
},
),
],
),
),
);
}
}


Comments

Popular posts from this blog

Pagination with Bloc Pattern in Flutter

Pagination First Practical in Flutter

ExpansionPanel with ExpansionPanelList with Complete Collapse Operation in Flutter