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