Skip to content

Commit dd68876

Browse files
committed
fixed status bar color issues
1 parent 1bc6509 commit dd68876

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

lib/route_app.dart

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ class RouteApp extends StatelessWidget {
2222
builder: (context, box, widget) {
2323
final theme = box.get('theme', defaultValue: ThemeEnum.light);
2424

25-
print("APP REBUILD");
26-
2725
// check if this is the first time using the app
2826
final settingsBox = Hive.box('settings');
2927
bool firstLaunch = settingsBox.get('first_launch', defaultValue: true);
@@ -50,16 +48,16 @@ class RouteApp extends StatelessWidget {
5048
darkTheme: darkTheme,
5149
theme: regTheme,
5250

53-
// nice IOS rubber band scrolling
54-
// child: _HomeAndStatusBar(home: home),
51+
// builder here to get context from MaterialApp
5552
home: Builder(
5653
builder: (BuildContext context) {
5754
// this should also reset when theme changed
5855

5956
// setStatusBarColor(context);
6057

58+
// nice IOS rubber band scrolling
6159
return ScrollConfiguration(
62-
child: _buildHome(home),
60+
child: _buildHome(context, home),
6361
behavior: BounceScrollBehavior(),
6462
);
6563
},
@@ -71,8 +69,12 @@ class RouteApp extends StatelessWidget {
7169
);
7270
}
7371

74-
Widget _buildHome(Widget home) {
75-
print("building!!!!!!!!!!");
72+
Widget _buildHome(BuildContext context, Widget home) {
73+
74+
// this is already being set from the setTheme function through the change theme button
75+
// doing it here too so the status bar is the correct color on app launch
76+
setStatusBarColor(context);
77+
7678
return ValueListenableBuilder(
7779
builder: (context, box, widget) {
7880
return home;

0 commit comments

Comments
 (0)