How to implement a side menu that swipes from the left?

后端 未结 3 1147
刺人心
刺人心 2021-02-07 16:39

I am new to Flutter and just finished the get started tutorial. I would like to create a side menu, which will appear from the left side when you swipe (like Gmail on Android).

3条回答
  •  离开以前
    2021-02-07 17:05

    In Scaffold just specify the drawer: Drawer()

    Example:

    class MyApp extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          drawer: Drawer(   // this will set the drawer
            child: MyWidget // render your drawer Widget here
          ),
          ... // props hidden
        );
      }
    }
    

提交回复
热议问题