fix: Status bar color
This commit is contained in:
parent
6bcf349813
commit
973c6b2fd5
1 changed files with 35 additions and 22 deletions
|
|
@ -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,7 +76,22 @@ class FluffyChatApp extends StatelessWidget {
|
||||||
apl: _apl,
|
apl: _apl,
|
||||||
testClient: testClient,
|
testClient: testClient,
|
||||||
child: Builder(
|
child: Builder(
|
||||||
builder: (context) => AdaptivePageLayout(
|
builder: (context) {
|
||||||
|
final darkMode =
|
||||||
|
Theme.of(context).brightness == Brightness.dark;
|
||||||
|
final brightness =
|
||||||
|
darkMode ? Brightness.light : Brightness.dark;
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
|
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
|
||||||
|
systemNavigationBarColor:
|
||||||
|
Theme.of(context).scaffoldBackgroundColor,
|
||||||
|
statusBarColor: Colors.transparent,
|
||||||
|
statusBarBrightness: brightness,
|
||||||
|
statusBarIconBrightness: brightness,
|
||||||
|
systemNavigationBarIconBrightness: brightness,
|
||||||
|
));
|
||||||
|
});
|
||||||
|
return AdaptivePageLayout(
|
||||||
key: _apl,
|
key: _apl,
|
||||||
safeAreaOnColumnView: false,
|
safeAreaOnColumnView: false,
|
||||||
onGenerateRoute: testWidget == null
|
onGenerateRoute: testWidget == null
|
||||||
|
|
@ -97,7 +109,8 @@ class FluffyChatApp extends StatelessWidget {
|
||||||
}.contains(settings.name)
|
}.contains(settings.name)
|
||||||
? MaterialPageRoute(builder: builder)
|
? MaterialPageRoute(builder: builder)
|
||||||
: FadeRoute(page: builder(context)),
|
: FadeRoute(page: builder(context)),
|
||||||
),
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue