0% found this document useful (0 votes)
18 views4 pages

#Drawers#

Uploaded by

velampudiv
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views4 pages

#Drawers#

Uploaded by

velampudiv
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

#Drawers#

drawer is nothing but the when we click on the side 3 bars we are going to get the
drawer one which contains the info and some options of related when we are in
Instagram and we are in profikle page trying to see the saved videos so this is the
way we called the drawer.

as earlier steps follows.

stateful widget used.


appbar is used
in appbar title is used.

body: container(
child:center(
child:text('hey'))

here what we done is so simple one we done in many times in the earlier of the
concepts.from now
we are defining the drawer property.

return scaffold(
drawer:Drawer(
child:container()
)
appbar:Appbar

after giving the drawer property it gives the bar in the side corner.

drawer:Drawer(
child:container(
color: Theme.of(context).primarycolor,

here from the above it gives the primary color to the drawer
so by using the primary color it gives thecolor to it.

drawer:drawer(
child:container(color:Theme.of(context).primarycolor,
child:ListView(
children:[
DrawerHeader(
child:container()
]

here from the given data we can describe that drawer header to create a header
block in the drawer.

DrawerHeader(
child:container(
Theme.of(context).primarycolor,
child:ListView(
children:[
DrawerHeader(
padding: edgeinsets.zero,
child:Container(
color:colors.red,
padding:EdgeInsets.Zero,
child:row(
children[]

]
))

by here we are going to create drawer colors.


here by using padding we created the special color space in the drawer header
after the drawer header bracket we use the Listtile will be given and in the List
tile we give

ListTile(leading:Icon(Icons.folder),
title:Text('files')),

by using this we can create a folder contents in the below section of the drawer
header
we can build so many folders here.

after this in the drawer header we have defined the row(children[]).


in that we have to fill.

CircleAvator(radius:40,
backgroundimage:NetworkImage('https://www.google.com/url?sa=i&url=https%3A%2F
%2Fpixabay.com%2Fimages%2Fsearch%2Fbatman%2F&psig=AOvVaw1I2NXtvJ4-
ce6yG_20TVSe&ust=1718104607739000&source=images&cd=vfe&opi=89978449&ved=0CBAQjRxqFw
oTCMiA6Mn00IYDFQAAAAAdAAAAABAE'))

by using this the drawer header pic will be given.

children: <Widget>[
CircleAvatar(radius: 40,
backgroundImage: NetworkImage('https://www.google.com/url?
sa=i&url=https%3A%2F%2Ffanyv88.com%3A443%2Fhttps%2Fpixabay.com%2Fimages%2Fsearch%2Fbatman
%2F&psig=AOvVaw1I2NXtvJ4-
ce6yG_20TVSe&ust=1718104607739000&source=images&cd=vfe&opi=89978449&ved=0CBAQjRxqFw
oTCMiA6Mn00IYDFQAAAAAdAAAAABAE'),
),
SizedBox(width: 10),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('batman'),
Text('bruce wayne')

by using the sized box after the network image we can using sized box to give the
perfect width.
by using the column in column the text will be given in that and after that the
mainaxisalignment and cross axis alignment will be given to the text in a format.

import 'package:flutter/material.dart';

class DrawerWidget extends StatefulWidget {


const DrawerWidget({Key? key}) : super(key: key);

@override
_DrawerWidgetState createState() => _DrawerWidgetState();
}

class _DrawerWidgetState extends State<DrawerWidget> {


@override
Widget build(BuildContext context) {
//drawer / end Drawer
return Scaffold(
appBar: AppBar(
title: Text('Drawer Widget'),
),
drawer: Drawer(
child: Container(
color: Colors.deepPurple.shade900,
child: ListView(
children: [
DrawerHeader(
padding: EdgeInsets.zero,
child: Container(
padding: EdgeInsets.all(10),
child: Center(
child: Row(children: [
CircleAvatar(
radius: 40,
backgroundImage: NetworkImage(

'https://www.dmarge.com/wp-content/uploads/2021/01/dwayne-the-rock-.jpg')),
SizedBox(width: 10),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Akshit Madan',
style: TextStyle(fontSize: 18),
),
Text('Data Science'),
])
]),
),
),
),
ListTile(
leading: Icon(Icons.folder),
title: Text('My Files'),
),
ListTile(
leading: Icon(Icons.group),
title: Text('Shared with me'),
),
ListTile(
leading: Icon(Icons.star),
title: Text('Starred'),
),
ListTile(
leading: Icon(Icons.delete),
title: Text('Trash'),
),
ListTile(
leading: Icon(Icons.upload),
title: Text('Uploads'),
),
],
),
)),
body: Center(
child: Text('Hello'),
),
);
}
}

You might also like