mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
use ColorSchemeSeed instead of own ColorScheme
This commit is contained in:
19
lib/app.dart
19
lib/app.dart
@@ -19,8 +19,6 @@ class MyApp extends StatelessWidget {
|
||||
setTransparentNavigationBar(context);
|
||||
primaryColor = Color(_setting.primaryColor.fetch()!);
|
||||
|
||||
final primarySwatch = primaryColor.materialColor;
|
||||
|
||||
return ValueListenableBuilder<int>(
|
||||
valueListenable: _setting.themeMode.listenable(),
|
||||
builder: (_, tMode, __) {
|
||||
@@ -33,19 +31,14 @@ class MyApp extends StatelessWidget {
|
||||
supportedLocales: S.supportedLocales,
|
||||
title: BuildData.name,
|
||||
themeMode: themeMode,
|
||||
theme: ThemeData.light(useMaterial3: true).copyWith(
|
||||
colorScheme: ColorScheme.fromSwatch(
|
||||
primarySwatch: primarySwatch,
|
||||
accentColor: primaryColor,
|
||||
theme: ThemeData(
|
||||
useMaterial3: true,
|
||||
colorSchemeSeed: primaryColor,
|
||||
),
|
||||
switchTheme: ThemeData.light(useMaterial3: true).switchTheme,
|
||||
),
|
||||
darkTheme: ThemeData.dark(useMaterial3: true).copyWith(
|
||||
colorScheme: ColorScheme.fromSwatch(
|
||||
darkTheme: ThemeData(
|
||||
useMaterial3: true,
|
||||
brightness: Brightness.dark,
|
||||
primarySwatch: primarySwatch,
|
||||
accentColor: primaryColor,
|
||||
),
|
||||
colorSchemeSeed: primaryColor,
|
||||
),
|
||||
home: const MyHomePage(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user