TL;TR: Prevent Google Sign In to change the SystemUiOverlayStyle that causes #51
It seems that the SystemUiOverlayStyle applied in main() is changed by Google Sign In modal when “Sign in with Google” button is tapped. Then, home_page.dart is redrawn and the AppBar inherits last used value (Google's dark style, instead of theme.dart's light style). To fix it, home_page.dart has to use theme.dart's SystemUiOverlayStyle.
AppBar internally creates an AnnotatedRegion<SystemUiOverlayStyle> widget that is processed by Flutter's native UI bindings. It makes the status bar either dark or bright.
On screens without an AppBar, you can use AnnotatedRegion<SystemUiOverlayStyle> to set the color of the status bar.
However if you have multiple widgets which set this value, or use the material AppBar or cupertino NavBar your value may be overwritten by them. Instead you could use the new AnnotatedRegion API to tell flutter to automatically switch to this style anytime certain widgets are visible.
TL;TR: Prevent Google Sign In to change the
SystemUiOverlayStyle
that causes #51It seems that the
SystemUiOverlayStyle
applied inmain()
is changed by Google Sign In modal when “Sign in with Google” button is tapped. Then,home_page.dart
is redrawn and theAppBar
inherits last used value (Google's dark style, instead oftheme.dart
's light style). To fix it,home_page.dart
has to usetheme.dart
'sSystemUiOverlayStyle
.From this Stack Overflow answer:
And from this other: