diff --git a/lib/config/themes.dart b/lib/config/themes.dart index c7165149..5fa138f8 100644 --- a/lib/config/themes.dart +++ b/lib/config/themes.dart @@ -58,9 +58,11 @@ abstract class FluffyThemes { surfaceTintColor: brightness == Brightness.light ? Colors.white : Colors.black, shadowColor: Colors.black.withAlpha(64), - systemOverlayStyle: brightness == Brightness.light - ? SystemUiOverlayStyle.dark - : SystemUiOverlayStyle.light, + systemOverlayStyle: SystemUiOverlayStyle( + statusBarColor: Colors.transparent, + statusBarIconBrightness: brightness.reversed, + statusBarBrightness: brightness, + ), ), elevatedButtonTheme: ElevatedButtonThemeData( style: ElevatedButton.styleFrom( @@ -70,3 +72,8 @@ abstract class FluffyThemes { ), ); } + +extension on Brightness { + Brightness get reversed => + this == Brightness.dark ? Brightness.light : Brightness.dark; +} diff --git a/lib/pages/connect/connect_page_view.dart b/lib/pages/connect/connect_page_view.dart index 4de1588b..20fe4ad4 100644 --- a/lib/pages/connect/connect_page_view.dart +++ b/lib/pages/connect/connect_page_view.dart @@ -20,9 +20,6 @@ class ConnectPageView extends StatelessWidget { return LoginScaffold( appBar: AppBar( automaticallyImplyLeading: !controller.loading, - backgroundColor: Colors.transparent, - iconTheme: const IconThemeData(color: Colors.white), - elevation: 0, centerTitle: true, title: Text( Matrix.of(context).getLoginClient().homeserver?.host ?? '', diff --git a/lib/pages/homeserver_picker/homeserver_picker_view.dart b/lib/pages/homeserver_picker/homeserver_picker_view.dart index c44e3c94..e692aaa0 100644 --- a/lib/pages/homeserver_picker/homeserver_picker_view.dart +++ b/lib/pages/homeserver_picker/homeserver_picker_view.dart @@ -18,33 +18,21 @@ class HomeserverPickerView extends StatelessWidget { final benchmarkResults = controller.benchmarkResults; return LoginScaffold( appBar: AppBar( - elevation: 0, - scrolledUnderElevation: 0, - backgroundColor: Colors.transparent, actions: [ IconButton( onPressed: controller.restoreBackup, tooltip: L10n.of(context)!.hydrate, - icon: const Icon( - Icons.restore_outlined, - color: Colors.white, - ), + icon: const Icon(Icons.restore_outlined), ), IconButton( tooltip: L10n.of(context)!.privacy, onPressed: () => launch(AppConfig.privacyUrl), - icon: const Icon( - Icons.shield_outlined, - color: Colors.white, - ), + icon: const Icon(Icons.shield_outlined), ), IconButton( tooltip: L10n.of(context)!.about, onPressed: () => PlatformInfos.showDialog(context), - icon: const Icon( - Icons.info_outlined, - color: Colors.white, - ), + icon: const Icon(Icons.info_outlined), ), ], ), diff --git a/lib/pages/login/login_view.dart b/lib/pages/login/login_view.dart index 0da6b382..e31b83f3 100644 --- a/lib/pages/login/login_view.dart +++ b/lib/pages/login/login_view.dart @@ -16,9 +16,6 @@ class LoginView extends StatelessWidget { return LoginScaffold( appBar: AppBar( automaticallyImplyLeading: !controller.loading, - backgroundColor: Colors.transparent, - iconTheme: const IconThemeData(color: Colors.white), - elevation: 0, centerTitle: true, title: Text( L10n.of(context)!.logInTo(Matrix.of(context) diff --git a/lib/pages/sign_up/signup_view.dart b/lib/pages/sign_up/signup_view.dart index ad16533b..a9224e3c 100644 --- a/lib/pages/sign_up/signup_view.dart +++ b/lib/pages/sign_up/signup_view.dart @@ -14,9 +14,6 @@ class SignupPageView extends StatelessWidget { return LoginScaffold( appBar: AppBar( automaticallyImplyLeading: !controller.loading, - backgroundColor: Colors.transparent, - iconTheme: const IconThemeData(color: Colors.white), - elevation: 0, title: Text( L10n.of(context)!.signUp, style: const TextStyle(color: Colors.white), diff --git a/lib/widgets/layouts/login_scaffold.dart b/lib/widgets/layouts/login_scaffold.dart index 1183c1e9..a47f11bd 100644 --- a/lib/widgets/layouts/login_scaffold.dart +++ b/lib/widgets/layouts/login_scaffold.dart @@ -13,19 +13,19 @@ class LoginScaffold extends StatelessWidget { @override Widget build(BuildContext context) { - WidgetsBinding.instance.addPostFrameCallback((_) { - SystemChrome.setSystemUIOverlayStyle( - const SystemUiOverlayStyle( - statusBarIconBrightness: Brightness.light, - statusBarColor: Colors.transparent, - systemNavigationBarContrastEnforced: false, - systemNavigationBarColor: Colors.black, - systemNavigationBarIconBrightness: Brightness.light, - ), - ); - }); return Scaffold( - appBar: appBar, + appBar: AppBar( + automaticallyImplyLeading: appBar?.automaticallyImplyLeading ?? true, + centerTitle: appBar?.centerTitle, + title: appBar?.title, + leading: appBar?.leading, + actions: appBar?.actions, + iconTheme: const IconThemeData(color: Colors.white), + elevation: 0, + scrolledUnderElevation: 0, + backgroundColor: Colors.transparent, + systemOverlayStyle: SystemUiOverlayStyle.light, + ), extendBodyBehindAppBar: true, extendBody: true, body: Container(