添加抽屉后看不到抽屉汉堡图标

Dav*_*ave 5 flutter

我正在尝试添加一个抽屉,该抽屉应将侧面菜单打开为全屏。但是添加后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)

Diw*_*nsh 7

您无法看到,Icon因为您已设置automaticallyImplyLeadingfalse,只需将其更改为 true 或删除该行,您的Icon就会出现

automaticallyImplyLeading: true, //even can remove this line
Run Code Online (Sandbox Code Playgroud)