mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
new: picker & opt. rm -r
This commit is contained in:
18
lib/app.dart
18
lib/app.dart
@@ -73,22 +73,14 @@ class MyApp extends StatelessWidget {
|
||||
|
||||
Widget _wrapSystemColor(BuildContext context, Widget child) {
|
||||
return DynamicColorBuilder(builder: (light, dark) {
|
||||
_setupPrimaryColor(context, light, dark);
|
||||
if (context.isDark && light != null) {
|
||||
primaryColor = light.primary;
|
||||
} else if (!context.isDark && dark != null) {
|
||||
primaryColor = dark.primary;
|
||||
}
|
||||
return child;
|
||||
});
|
||||
}
|
||||
|
||||
void _setupPrimaryColor(
|
||||
BuildContext context,
|
||||
ColorScheme? light,
|
||||
ColorScheme? dark,
|
||||
) {
|
||||
if (context.isDark && light != null) {
|
||||
primaryColor = light.primary;
|
||||
} else if (!context.isDark && dark != null) {
|
||||
primaryColor = dark.primary;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ThemeData _getAmoledTheme(ThemeData darkTheme) => darkTheme.copyWith(
|
||||
|
||||
Reference in New Issue
Block a user