网站建设之如何实现从左侧滑动的侧边菜单?

在此示例中,我们将学习如何实现从左侧滑动的侧面菜单?这是一个简单抽屉的示例(网站建设只是通过flutter create修改了默认项目设置):
如何实现从左侧滑动的侧边菜单以下是实现侧面菜单的示例,该侧面菜单在flutter应用程序中从左侧滑动:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import ‘package:flutter/material.dart’;
void main() {
runapp(new myapp());
}
class myapp extends statelesswidget {
@override
widget build(buildcontext context) {
?return new materialapp(
title: ‘flutter demo’,
home: new myhomepage(),
?);
}
}
class myhomepage extends statefulwidget {
@override
_myhomepagestate createstate() => new _myhomepagestate();
}
class _myhomepagestate extends state<myhomepage> {
@override
widget build(buildcontext context) {
?return new scaffold(
appbar: new appbar(
?title: new text(‘testproject’),
),
drawer: new drawer(
?child: new listview(
children: <widget> [
new drawerheader(child: new text(‘header’),),
new listtile(
title: new text(‘first menu item’),
ontap: () {},
),
new listtile(
title: new text(‘second menu item’),
ontap: () {},
),
new divider(),
new listtile(
title: new text(‘about’),
ontap: () {},
),
],
?)
),
body: new center(
?child: new text(
‘center’,
?),
),
?);
}
}
上一个:互联网时代利用网站打造企业品牌 需要在这样做
下一个:如何为UI设计模式添加创新
潍坊网站建设,潍坊做网站,潍坊网站设计