在flutter的Scaffold类中,定义appbar的title,再定义drawer,会自动生产drawer的弹出按钮,代码如下:
@override
Widgetbuild(BuildContext context) {
return Scaffold(
appBar:AppBar(title:Text('me'),),
drawer:Drawer(
child:Text('what'),
),
body:Column(
children: getTextButtonList(),
),
);
}
通过自定义按钮:就可以打开
onPressed() { Scaffold.of(context).openDrawer(); }