我尝试制作一个按钮来打开抽屉,但我不能,这是我第一次使用 flutter
我的运行界面

return Scaffold(
drawer: Drawer(),
body: Column(
children: <Widget>[
ClipPath(
clipper: MyClipper(),
child: Container(
height: 350,
width: double.infinity,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topRight,
end: Alignment.bottomLeft,
colors: [
Color(0xFF3383CD),
Color(0xFF11429F),
]),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(height: 12),
IconButton(
icon: const Icon(
Icons.add, size: 18,
color: Colors.white,
),
onPressed: () {
Scaffold.of(context).openDrawer();
},
),
Run Code Online (Sandbox Code Playgroud) flutter flutter-test flutter-layout flutter-animation flutter-web