Create Drawer With Title Header in Flutter
Dipen Maharjan
Posted on March 13, 2022
Create Scaffold
At home class, create a scaffold widget and inside that widget add drawer.
Scaffold(
drawer: const CustomDrawer(),
body: ....
)
Create CustomDrawer
...
Widget build(BuildContext context) {
return Drawer(
child: ListView(
children: [
SizedBox(height: 80, child:
child: DrawerHeader(
child: Image.network("url", fit: BoxFit.contain),
),
),
ListTile(
onTap: () {}
horizontalTitleGap: 0.0,
leading: Icon(Icons.add, color: Colors.black, height: 16),
title: Text("Add New", style: TextStyle(color: Colors.black),),
),
const Divider(
height: 1,
thickness: 1,
),
const Padding(
padding: EdgeInsets.all(16.0),
child: Text('Header'),
),
ListTile(
onTap: () {}
horizontalTitleGap: 0.0,
leading: Icon(Icons.add, color: Colors.black, height: 16),
title: Text("Add New", style: TextStyle(color: Colors.black),),
),
]
),
);
}
...
Follow me @slimpotatoboy : Twitter, Instagram
💖 💪 🙅 🚩
Dipen Maharjan
Posted on March 13, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
privacy Caught in the Crunch My Journey from Snacks to 2 Million Exposed Users Privacy
November 30, 2024
devchallenge Submission for the DevCycle Feature Flag Challenge: Feature Flag Funhouse
November 30, 2024