feat: main screen use flex layouy

This commit is contained in:
Simon Ding
2024-07-16 15:35:42 +08:00
parent cb0a95c537
commit cf77d2bf26
2 changed files with 8 additions and 11 deletions

View File

@@ -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)
]))),
);
},

View File

@@ -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,
))
]));
]);
}
}