我正在尝试添加一个抽屉,该抽屉应将侧面菜单打开为全屏。但是添加后drawer我根本看不到抽屉图标。我究竟做错了什么?
我的代码:
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
title: const Text("Nav", style: TextStyle(
color: Colors.black
)),
centerTitle: true,
flexibleSpace: Image(
image: AssetImage('assets/images/bg.jpg'),
fit: BoxFit.cover,
),
bottomOpacity: 0,
elevation: 2,
backgroundColor: Colors.transparent,
),
drawer: Drawer(
child: Text("Test")
),
Run Code Online (Sandbox Code Playgroud)
您无法看到,Icon因为您已设置automaticallyImplyLeading为false,只需将其更改为 true 或删除该行,您的Icon就会出现
automaticallyImplyLeading: true, //even can remove this line
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2668 次 |
| 最近记录: |