Skip to content

Commit

Permalink
feat: Expanding container to fill with black. #4
Browse files Browse the repository at this point in the history
  • Loading branch information
LuchoTurtle committed Apr 28, 2023
1 parent 35651d2 commit be26518
Showing 1 changed file with 25 additions and 18 deletions.
43 changes: 25 additions & 18 deletions lib/menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,31 @@ class _DrawerMenuState extends State<DrawerMenu> with SettingsManagerMixin {
),
),
]),
body: Container(
color: Colors.black,
child: FutureBuilder<List<MenuItemInfo>>(
future: menuItems,
builder: (BuildContext context, AsyncSnapshot<List<MenuItemInfo>> snapshot) {
// If the data is correctly loaded,
// we render a `ReorderableListView` whose children are `MenuItem` tiles.
if (snapshot.hasData) {
List<MenuItemInfo> menuItemInfoList = snapshot.data!;

return DrawerMenuTilesList(menuItemInfoList: menuItemInfoList);
}

// While it's not loaded (error or waiting)
else {
return const SizedBox.shrink();
}
})),

body: Column(
children: [
Expanded(
child: Container(
color: Colors.black,
child: FutureBuilder<List<MenuItemInfo>>(
future: menuItems,
builder: (BuildContext context, AsyncSnapshot<List<MenuItemInfo>> snapshot) {
// If the data is correctly loaded,
// we render a `ReorderableListView` whose children are `MenuItem` tiles.
if (snapshot.hasData) {
List<MenuItemInfo> menuItemInfoList = snapshot.data!;

return DrawerMenuTilesList(menuItemInfoList: menuItemInfoList);
}

// While it's not loaded (error or waiting)
else {
return const SizedBox.shrink();
}
})),
),
],
),
);
}
}
Expand Down

0 comments on commit be26518

Please sign in to comment.