Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 2 additions & 38 deletions lib/common/ui/theme_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,7 @@ class ThemeUtils {
ThemeData getLightTheme(ColorScheme? lightDynamicColorScheme, bool dynamicTheming, Font appFont) {
final ColorScheme colorScheme;
if (dynamicTheming && lightDynamicColorScheme != null) {
// TODO: remove when dynamic_colors is updated to support new roles
// See https://github.com/material-foundation/flutter-packages/issues/582
final temporaryColorScheme = ColorScheme.fromSeed(seedColor: lightDynamicColorScheme.primary);

colorScheme = lightDynamicColorScheme.copyWith(
surfaceContainerLowest: temporaryColorScheme.surfaceContainerLowest,
surfaceContainerLow: temporaryColorScheme.surfaceContainerLow,
surfaceContainer: temporaryColorScheme.surfaceContainer,
surfaceContainerHigh: temporaryColorScheme.surfaceContainerHigh,
surfaceContainerHighest: temporaryColorScheme.surfaceContainerHighest,
);
colorScheme = lightDynamicColorScheme;
} else {
colorScheme = ColorScheme.fromSeed(seedColor: customPrimaryColor);
}
Expand All @@ -91,33 +81,7 @@ class ThemeUtils {
final ColorScheme colorScheme;

if (dynamicTheming && darkDynamicColorScheme != null) {
// TODO: remove when dynamic_colors is updated to support new roles
// See https://github.com/material-foundation/flutter-packages/issues/582
final temporaryColorScheme = ColorScheme.fromSeed(
brightness: Brightness.dark,
seedColor: darkDynamicColorScheme.primary,
);

colorScheme = blackTheming
? darkDynamicColorScheme.copyWith(
// TODO: remove when dynamic_colors is updated to support new roles
// See https://github.com/material-foundation/flutter-packages/issues/582
// ignore: deprecated_member_use
background: Colors.black,
surface: Colors.black,
surfaceContainerLowest: temporaryColorScheme.surfaceContainerLowest,
surfaceContainerLow: temporaryColorScheme.surfaceContainerLow,
surfaceContainer: temporaryColorScheme.surfaceContainer,
surfaceContainerHigh: temporaryColorScheme.surfaceContainerHigh,
surfaceContainerHighest: temporaryColorScheme.surfaceContainerHighest,
)
: darkDynamicColorScheme.copyWith(
surfaceContainerLowest: temporaryColorScheme.surfaceContainerLowest,
surfaceContainerLow: temporaryColorScheme.surfaceContainerLow,
surfaceContainer: temporaryColorScheme.surfaceContainer,
surfaceContainerHigh: temporaryColorScheme.surfaceContainerHigh,
surfaceContainerHighest: temporaryColorScheme.surfaceContainerHighest,
);
colorScheme = blackTheming ? darkDynamicColorScheme.copyWith(surface: Colors.black) : darkDynamicColorScheme;
} else {
colorScheme = blackTheming
? ColorScheme.fromSeed(brightness: Brightness.dark, seedColor: customPrimaryColor, surface: Colors.black)
Expand Down
5 changes: 1 addition & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ Future<void> main() async {
// Keep the splash screen until all initializations are done
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);

// Display the application behind the system's notifications bar and navigation bar
// See https://github.com/flutter/flutter/issues/40974
// See https://github.com/flutter/flutter/issues/34678
await SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
// The application is already displayed behind the system's notifications bar and navigation bar (edge-to-edge)
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(systemNavigationBarColor: Colors.transparent));

// Initialize the utilities
Expand Down
Loading