How to place Drawer widget on the right

后端 未结 3 1660
甜味超标
甜味超标 2021-01-01 10:06

How to place Drawer widget on the right. Also is possible to place two Drawer widget in a single page one either side of the appbar

Widget build(BuildContext         


        
相关标签:
3条回答
  • 2021-01-01 10:25

    If you want to keep the button on right and the drawer in the left, then add the hamburger button inside a container, so that hamburger button will be on the right side and the navigation drawer remains in the left side. (not recommended)

    new Container( alignment: Alignment.topRight, margin: EdgeInsets.only(top: 20.0, right: 10.0), child: IconButton( icon: Icon(Icons.menu, size: 24, color: Colors.white,), onPressed: () => scaffoldKey.currentState.openDrawer(), ), )

    0 讨论(0)
  • 2021-01-01 10:31
      endDrawer:Drawer(child:Center(child:Columun(   children: <Widget>[
              Text('End Drawer)           ],
          ),))
      
    
    0 讨论(0)
  • 2021-01-01 10:36

    By using endDrawer: ... instead or in addition to drawer: ... to set a drawer.

    See also https://docs.flutter.io/flutter/material/Scaffold/endDrawer.html

    0 讨论(0)
提交回复
热议问题