1.Divider() 组件 中间一根线
2.抽屉组件
//左边栏,右边栏
drawer: Drawer(
child: ListView(
children: <Widget>[
//抽屉头
DrawerHeader(
child: Text("data"),
)
],
),
),
//右抽屉
endDrawer: Drawer(
child: Text('你好'),
),
import 'package:flutter/material.dart';
class SetController extends StatefulWidget {
@override
_SetControllerState createState() => _SetControllerState();
}
class _SetControllerState extends State<SetController> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("设置"),
),
drawer: Drawer(
child: ListView(
children: <Widget>[
//头
UserAccountsDrawerHeader(
accountName: Text("123"),
),
//头
DrawerHeader(
child: Text("data"),
),
ListTile(
title: Text("gogogo"),
onTap: (){
Navigator.of(context).pop();//关闭侧边栏
},
)
],
),
),
endDrawer: Drawer(
child: Text('你好'),
),
);
}
}
网友评论