chore: Follow up fix systemuioverlaystyle

This commit is contained in:
Christian Pauly 2022-08-28 11:39:33 +02:00
parent 06ee00464a
commit 8e04f4cc73
6 changed files with 25 additions and 39 deletions

View File

@ -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;
}

View File

@ -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 ?? '',

View File

@ -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),
),
],
),

View File

@ -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)

View File

@ -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),

View File

@ -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(