通过事件打开侧边栏

final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
 
return Scaffold(
key:_scaffoldKey,
appBar: AppBar(
title: Text("商品列表"),
)
)

Expanded(
flex: 1,
child: InkWell(
child: Padding(
padding: EdgeInsets.fromLTRB(
0, ScreenAdaper.height(16), 0, ScreenAdaper.height(16)),
child: Text("筛选", textAlign: TextAlign.center),
),
onTap: () {
_scaffoldKey.currentState.openEndDrawer();
},
),
),
原文地址:https://www.cnblogs.com/zhaofeis/p/12384680.html