mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-06 01:57:40 +08:00
feat: main screen use flex layouy
This commit is contained in:
@@ -67,10 +67,13 @@ class MyApp extends StatelessWidget {
|
||||
body: Center(
|
||||
// Center is a layout widget. It takes a single child and positions it
|
||||
// in the middle of the parent.
|
||||
child: Row(children: <Widget>[
|
||||
const NavDrawer(),
|
||||
child: Flex(direction: Axis.horizontal, children: <Widget>[
|
||||
const Flexible(
|
||||
flex: 1,
|
||||
child: NavDrawer(),
|
||||
),
|
||||
const VerticalDivider(thickness: 1, width: 1),
|
||||
Expanded(child: child)
|
||||
Flexible(flex: 7, child: child)
|
||||
]))),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -20,9 +20,7 @@ class _NavDrawerState extends State<NavDrawer> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 220),
|
||||
child: Row(
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -68,14 +66,10 @@ class _NavDrawerState extends State<NavDrawer> {
|
||||
icon: Icon(Icons.settings),
|
||||
label: Text('设置'),
|
||||
),
|
||||
NavigationRailDestination(
|
||||
icon: Icon(Icons.computer),
|
||||
label: Text('系统'),
|
||||
),
|
||||
],
|
||||
//groupAlignment: -1,
|
||||
minWidth: 56,
|
||||
))
|
||||
]));
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user