flutter drawer
Scaffold( drawer: Drawer( child: ListView( padding: EdgeInsets.zero, children: [ DrawerHeader( child: Text("Header")), ListTile( title: Text("Home")) ]), ), );
flutter drawer
Scaffold( drawer: Drawer( child: ListView( padding: EdgeInsets.zero, children: [ DrawerHeader( child: Text("Header")), ListTile( title: Text("Home")) ]), ), );
flutter drawer
Scaffold( appBar: AppBar( title: const Text('Drawer Demo'), ), drawer: Drawer( child: ListView( padding: EdgeInsets.zero, children: const <Widget>[ DrawerHeader( decoration: BoxDecoration( color: Colors.blue, ), child: Text( 'Drawer Header', style: TextStyle( color: Colors.white, fontSize: 24, ), ), ), ListTile( leading: Icon(Icons.message), title: Text('Messages'), ), ListTile( leading: Icon(Icons.account_circle), title: Text('Profile'), ), ListTile( leading: Icon(Icons.settings), title: Text('Settings'), ), ], ), ), )
app drawer in flutter
class navigationDrawer extends StatelessWidget { @override Widget build(BuildContext context) { return Drawer( child: ListView( padding: EdgeInsets.zero, children: <Widget>[ createDrawerHeader(), createDrawerBodyItem( icon: Icons.home,text: 'Home'), createDrawerBodyItem( icon: Icons.account_circle,text: 'Profile'), createDrawerBodyItem( icon: Icons.event_note,text: 'Events'), Divider(), createDrawerBodyItem( icon: Icons.notifications_active,text: 'Notifications'), createDrawerBodyItem( icon: Icons.contact_phone,text: 'Contact Info'), ListTile( title: Text('App version 1.0.0'), onTap: () {}, ), ], ), ); } }
add a drawer flutter
Drawer( // Add a ListView to the drawer. This ensures the user can scroll // through the options in the drawer if there isn't enough vertical // space to fit everything. child: ListView( // Important: Remove any padding from the ListView. padding: EdgeInsets.zero, children: <Widget>[ DrawerHeader( decoration: BoxDecoration( color: Colors.blue, ), child: Text('Drawer Header'), ), ListTile( title: Text('Item 1'), onTap: () { // Update the state of the app. // ... }, ), ListTile( title: Text('Item 2'), onTap: () { // Update the state of the app. // ... }, ), ], ), );
app drawer in flutter
Widget createDrawerHeader() { return DrawerHeader( margin: EdgeInsets.zero, padding: EdgeInsets.zero, decoration: BoxDecoration( image: DecorationImage( fit: BoxFit.fill, image: AssetImage('images/bg_header.jpeg'))), child: Stack(children: <Widget>[ Positioned( bottom: 12.0, left: 16.0, child: Text("Welcome to Flutter", style: TextStyle( color: Colors.white, fontSize: 20.0, fontWeight: FontWeight.w500))), ])); }
app drawer in flutter
Widget createDrawerBodyItem( {IconData icon, String text, GestureTapCallback onTap}) { return ListTile( title: Row( children: <Widget>[ Icon(icon), Padding( padding: EdgeInsets.only(left: 8.0), child: Text(text), ) ], ), onTap: onTap, ); }
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us