#Drawers#
#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.
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[]
]
))
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.
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'))
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';
@override
_DrawerWidgetState createState() => _DrawerWidgetState();
}
'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'),
),
);
}
}