Fix #726: Status bar wrong theme in dark mode
This commit is contained in:
parent
e0ecdee5d5
commit
7c4409b2ec
2 changed files with 16 additions and 12 deletions
|
|
@ -67,6 +67,11 @@ abstract class FluffyThemes {
|
|||
brightness: brightness,
|
||||
seedColor: seed ?? AppConfig.colorSchemeSeed ?? AppConfig.primaryColor,
|
||||
);
|
||||
// Sets status and navigation bar style whenever buildTheme called
|
||||
SystemChrome.setSystemUIOverlayStyle(
|
||||
getOverlayStyle(brightness, colorScheme),
|
||||
);
|
||||
|
||||
return ThemeData(
|
||||
visualDensity: VisualDensity.standard,
|
||||
useMaterial3: true,
|
||||
|
|
@ -99,13 +104,7 @@ abstract class FluffyThemes {
|
|||
toolbarHeight: FluffyThemes.isColumnMode(context) ? 72 : 56,
|
||||
shadowColor: Colors.grey.withAlpha(64),
|
||||
surfaceTintColor: colorScheme.background,
|
||||
systemOverlayStyle: SystemUiOverlayStyle(
|
||||
statusBarColor: Colors.transparent,
|
||||
statusBarIconBrightness: brightness.reversed,
|
||||
statusBarBrightness: brightness,
|
||||
systemNavigationBarIconBrightness: brightness.reversed,
|
||||
systemNavigationBarColor: colorScheme.background,
|
||||
),
|
||||
systemOverlayStyle: getOverlayStyle(brightness, colorScheme),
|
||||
),
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style: TextButton.styleFrom(
|
||||
|
|
@ -142,6 +141,16 @@ abstract class FluffyThemes {
|
|||
),
|
||||
);
|
||||
}
|
||||
|
||||
static getOverlayStyle(Brightness brightness, ColorScheme colorScheme) {
|
||||
return SystemUiOverlayStyle(
|
||||
statusBarColor: Colors.transparent,
|
||||
statusBarIconBrightness: brightness.reversed,
|
||||
statusBarBrightness: brightness,
|
||||
systemNavigationBarIconBrightness: brightness.reversed,
|
||||
systemNavigationBarColor: colorScheme.background,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension on Brightness {
|
||||
|
|
|
|||
|
|
@ -392,11 +392,6 @@ class ChatListController extends State<ChatList>
|
|||
Matrix.of(context).store.getString(_serverStoreNamespace);
|
||||
Matrix.of(context).backgroundPush?.setupPush();
|
||||
}
|
||||
|
||||
// Workaround for system UI overlay style not applied on app start
|
||||
SystemChrome.setSystemUIOverlayStyle(
|
||||
Theme.of(context).appBarTheme.systemOverlayStyle!,
|
||||
);
|
||||
});
|
||||
|
||||
_checkTorBrowser();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue