Skip to content

Commit 15de0bd

Browse files
committed
redesign challenges menu
1 parent 87d8546 commit 15de0bd

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

lib/core/presentation/pages/home.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class _HomePageState extends State<HomePage> {
3131
accentColor: Colors.indigo,
3232
),
3333
child: Scaffold(
34+
backgroundColor: Colors.grey.shade300,
3435
appBar: AppBar(
3536
title: Text("UI Challenges"),
3637
),

lib/core/presentation/pages/main_menu.dart

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import 'package:flutter_ui_challenges/core/data/models/menu.dart';
1010
import 'package:flutter_ui_challenges/core/presentation/widgets/preview.dart';
1111
import 'package:flutter_ui_challenges/features/auth/data/model/user.dart';
1212
import 'package:flutter_ui_challenges/features/auth/data/model/user_repository.dart';
13+
import 'package:flutter_ui_challenges/src/pages/bike/bike_details.dart';
1314
import 'package:package_info/package_info.dart';
1415
import 'package:provider/provider.dart';
1516
import 'package:shared_preferences/shared_preferences.dart';
@@ -26,7 +27,7 @@ class _MainMenuState extends State<MainMenu> {
2627
List<SubMenuItem> unseen;
2728
bool dialogShowing;
2829
bool showNewUiDialog;
29-
30+
3031
@override
3132
void initState() {
3233
super.initState();
@@ -65,7 +66,13 @@ class _MainMenuState extends State<MainMenu> {
6566
children: <Widget>[
6667
...pages.map((page) => page is MenuItem
6768
? _buildExpandableMenu(page, context)
68-
: _buildSubMenu(page, context))
69+
: BorderedContainer(
70+
margin: const EdgeInsets.symmetric(
71+
vertical: 4.0,
72+
horizontal: 8.0,
73+
),
74+
padding: const EdgeInsets.all(0),
75+
child: _buildSubMenu(page, context)))
6976
],
7077
);
7178
}
@@ -148,15 +155,20 @@ class _MainMenuState extends State<MainMenu> {
148155
return;
149156
}
150157
});
151-
return ExpansionTile(
152-
leading: Icon(page.icon),
153-
title: Text(
154-
"${page.title} (${page.items.length} layouts)",
155-
style: TextStyle(
156-
fontWeight: FontWeight.bold,
157-
color: hasChanges ? Colors.deepOrange : Colors.black87),
158+
return BorderedContainer(
159+
margin: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 4.0),
160+
padding: const EdgeInsets.all(0),
161+
elevation: 0,
162+
child: ExpansionTile(
163+
leading: Icon(page.icon),
164+
title: Text(
165+
"${page.title} (${page.items.length} layouts)",
166+
style: TextStyle(
167+
fontWeight: FontWeight.bold,
168+
color: hasChanges ? Colors.deepOrange : Colors.black87),
169+
),
170+
children: _buildSubMenus(page.items, context),
158171
),
159-
children: _buildSubMenus(page.items, context),
160172
);
161173
}
162174

0 commit comments

Comments
 (0)