custome navigation drawer flutter code example

Example 1: flutter navigation drawer

Widget _createDrawerItem(    {IconData icon, String text, GestureTapCallback onTap}) {  return ListTile(    title: Row(      children: [        Icon(icon),        Padding(          padding: EdgeInsets.only(left: 8.0),          child: Text(text),        )      ],    ),    onTap: onTap,  );}

Example 2: flutter navigation drawer

Widget _createHeader() {  return DrawerHeader(      margin: EdgeInsets.zero,      padding: EdgeInsets.zero,      decoration: BoxDecoration(          image: DecorationImage(              fit: BoxFit.fill,              image:  AssetImage('path/to/header_background.png'))),      child: Stack(children: [        Positioned(            bottom: 12.0,            left: 16.0,            child: Text("Flutter Step-by-Step",                style: TextStyle(                    color: Colors.white,                    fontSize: 20.0,                    fontWeight: FontWeight.w500))),      ]));}

Tags:

Misc Example