fix: Status bar color

This commit is contained in:
Christian Pauly 2021-05-16 11:57:53 +02:00
parent 85be044726
commit f347edd57b

View File

@ -28,9 +28,6 @@ void main() async {
// To make sure that the parts of flutter needed are started up already, we need to ensure that the // To make sure that the parts of flutter needed are started up already, we need to ensure that the
// widget bindings are initialized already. // widget bindings are initialized already.
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
));
FlutterError.onError = (FlutterErrorDetails details) => FlutterError.onError = (FlutterErrorDetails details) =>
Zone.current.handleUncaughtError(details.exception, details.stack); Zone.current.handleUncaughtError(details.exception, details.stack);
@ -79,25 +76,41 @@ class FluffyChatApp extends StatelessWidget {
apl: _apl, apl: _apl,
testClient: testClient, testClient: testClient,
child: Builder( child: Builder(
builder: (context) => AdaptivePageLayout( builder: (context) {
key: _apl, final darkMode =
safeAreaOnColumnView: false, Theme.of(context).brightness == Brightness.dark;
onGenerateRoute: testWidget == null final brightness =
? FluffyRoutes(context).onGenerateRoute darkMode ? Brightness.light : Brightness.dark;
: (_) => ViewData(mainView: (_) => testWidget), WidgetsBinding.instance.addPostFrameCallback((_) {
dividerColor: Theme.of(context).dividerColor, SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
columnWidth: FluffyThemes.columnWidth, systemNavigationBarColor:
dividerWidth: 1.0, Theme.of(context).scaffoldBackgroundColor,
routeBuilder: (builder, settings) => statusBarColor: Colors.transparent,
Matrix.of(context).loginState == LoginState.logged && statusBarBrightness: brightness,
!{ statusBarIconBrightness: brightness,
'/', systemNavigationBarIconBrightness: brightness,
'/search', ));
'/contacts', });
}.contains(settings.name) return AdaptivePageLayout(
? MaterialPageRoute(builder: builder) key: _apl,
: FadeRoute(page: builder(context)), safeAreaOnColumnView: false,
), onGenerateRoute: testWidget == null
? FluffyRoutes(context).onGenerateRoute
: (_) => ViewData(mainView: (_) => testWidget),
dividerColor: Theme.of(context).dividerColor,
columnWidth: FluffyThemes.columnWidth,
dividerWidth: 1.0,
routeBuilder: (builder, settings) =>
Matrix.of(context).loginState == LoginState.logged &&
!{
'/',
'/search',
'/contacts',
}.contains(settings.name)
? MaterialPageRoute(builder: builder)
: FadeRoute(page: builder(context)),
);
},
), ),
), ),
), ),