mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-01-20 17:14:30 +01:00
fix: Status bar and system navigation bar theme
This commit is contained in:
parent
6d7c52c61f
commit
d986986c97
@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:fluffychat/utils/platform_infos.dart';
|
import 'package:fluffychat/utils/platform_infos.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
import 'app_config.dart';
|
import 'app_config.dart';
|
||||||
|
|
||||||
@ -98,6 +99,11 @@ abstract class FluffyThemes {
|
|||||||
appBarTheme: AppBarTheme(
|
appBarTheme: AppBarTheme(
|
||||||
brightness: Brightness.light,
|
brightness: Brightness.light,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
|
systemOverlayStyle: SystemUiOverlayStyle(
|
||||||
|
systemNavigationBarColor: Colors.white,
|
||||||
|
systemNavigationBarIconBrightness: Brightness.dark,
|
||||||
|
statusBarColor: Colors.transparent,
|
||||||
|
),
|
||||||
textTheme: TextTheme(
|
textTheme: TextTheme(
|
||||||
headline6: TextStyle(
|
headline6: TextStyle(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
@ -176,6 +182,11 @@ abstract class FluffyThemes {
|
|||||||
appBarTheme: AppBarTheme(
|
appBarTheme: AppBarTheme(
|
||||||
brightness: Brightness.dark,
|
brightness: Brightness.dark,
|
||||||
color: Color(0xff1D1D1D),
|
color: Color(0xff1D1D1D),
|
||||||
|
systemOverlayStyle: SystemUiOverlayStyle(
|
||||||
|
systemNavigationBarColor: Colors.black,
|
||||||
|
systemNavigationBarIconBrightness: Brightness.light,
|
||||||
|
statusBarColor: Colors.transparent,
|
||||||
|
),
|
||||||
textTheme: TextTheme(
|
textTheme: TextTheme(
|
||||||
headline6: TextStyle(
|
headline6: TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
|
@ -10,7 +10,6 @@ import 'package:fluffychat/utils/sentry_controller.dart';
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:flutter_app_lock/flutter_app_lock.dart';
|
import 'package:flutter_app_lock/flutter_app_lock.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||||
import 'package:universal_html/html.dart' as html;
|
import 'package:universal_html/html.dart' as html;
|
||||||
@ -82,22 +81,7 @@ class FluffyChatApp extends StatelessWidget {
|
|||||||
apl: _apl,
|
apl: _apl,
|
||||||
testClient: testClient,
|
testClient: testClient,
|
||||||
child: Builder(
|
child: Builder(
|
||||||
builder: (context) {
|
builder: (context) => AdaptivePageLayout(
|
||||||
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
|
||||||
@ -115,8 +99,7 @@ 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…
Reference in New Issue
Block a user