Answers for "drawer flutter custom"

0

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'),
        ),
      ],
    ),
  ),
)
Posted by: Guest on May-31-2021
0

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: () {},
         ),
       ],
     ),
   );
 }
}
Posted by: Guest on November-26-2020

Browse Popular Code Answers by Language