How can I change Drawer icon in flutter?

This should work. Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title:Text(‘hi’), leading: IconButton( icon: Icon(Icons.accessible), onPressed: () => Scaffold.of(context).openDrawer(), ), ), ); From the docs -> {Widget leading} Type: Widget A widget to display before the How can I change Drawer icon in flutter?. If this is null and [automaticallyImplyLeading] is set to true, … Read more

How to get view from drawer header layout with binding in activity?

If you set app:headerLayout=”@layout/drawer_header then you don’t have to inflate the view again. You can just use .bind instead of .inflate. You can get the already inflated header view and bind it like this: View headerView = binding.navigationView.getHeaderView(0); DrawerHeaderBinding headerBinding = DrawerHeaderBinding.bind(headerView);

Android Navigation Drawer on top ActionBar

I have a tiny “trick” learnt from https://github.com/jfeinstein10/SlidingMenu to implement the effect you required. You only need to remove the first child of the window’s decor view, and add the first child to your drawer’s content view. After that, you only need to add your drawer to the window’s decor view. Below is some detailed … Read more

Change Flutter Drawer Background Color

When you build your ListView in the child property of your Drawer, you can wrap your different sections of the Drawer inside a Container and use the color property of the Container. drawer: new Drawer( child: new ListView( children: <Widget>[ new Container(child: new DrawerHeader(child: new CircleAvatar()),color: Colors.tealAccent,), new Container ( color: Colors.blueAccent, child: new Column( … Read more

Same Navigation Drawer in different Activities

If you want a navigation drawer, you should use fragments. I followed this tutorial last week and it works great: http://developer.android.com/training/implementing-navigation/nav-drawer.html You can also download sample code from this tutorial, to see how you can do this. Without fragments: This is your BaseActivity Code: public class BaseActivity extends Activity { public DrawerLayout drawerLayout; public ListView … Read more