首页 > 技术文章 > Flutter - 创建侧滑菜单

hupo376787 2018-11-27 11:49 原文

侧滑菜单在安卓App里面非常常见,比如Gmail,Google Play,Twitter等。看下图

 

网上也有很多创建侧滑菜单的教程,我也来记录一下,自己学习创建Drawer的过程。

 

1. 创建一个空的App

import 'package:flutter/material.dart';

class HomePage extends StatefulWidget{
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text('Hello Flutter'),
      ),
      body: new Center(
        child: new Text('Hello, Flutter!

推荐阅读