This commit is contained in:
Vadim 2023-01-26 18:33:33 +03:00
parent 42fe5d45bc
commit 179008ff77
2 changed files with 18 additions and 8 deletions

12
.vscode/settings.json vendored
View file

@ -1,8 +1,12 @@
{
"task.slowProviderWarning": true,
"dart.flutterSdkPaths": [
"fvm"
],
"dart.flutterSdkPath": "fvm",
"search.exclude": {
"**/.fvm": true
},
"files.watcherExclude": {
"**/.fvm": true
},
"dart.lineLength": 100,
"[dart]": {
"editor.formatOnSave": true,
@ -20,5 +24,5 @@
"dart.doNotFormat": [
"**/generated/**",
"lib/data/**"
]
],
}

View file

@ -26,7 +26,7 @@ class ThemeProvider extends StatefulWidget {
class ThemeProviderState extends State<ThemeProvider> {
UserPreferencesService get _prefs => context.read<UserPreferencesService>();
late final _themeTypeNotifier = ValueNotifier<ThemeType>(_prefs.themeType);
late final _dynamicColorNotifier = ValueNotifier<bool>(_prefs.dynamicColor);
late final _primaryColorNotifier = ValueNotifier<Color>(const Color(0xFF2196f3));
@ -159,6 +159,7 @@ class _ThemeDataProvider extends StatelessWidget {
final scheme = brightness == Brightness.light
? Scheme.light(primaryColor.value)
: Scheme.dark(primaryColor.value);
return ColorScheme(
brightness: brightness,
primary: Color(scheme.primary),
@ -171,10 +172,15 @@ class _ThemeDataProvider extends StatelessWidget {
onError: Color(scheme.onError),
background: Color(scheme.background),
onBackground: Color(scheme.onBackground),
surface: Color.alphaBlend(Color(scheme.primary).withOpacity(0.05), Color(scheme.background)),
surface: Color.alphaBlend(
Color(scheme.primary).withOpacity(0.05),
Color(scheme.background),
),
onSurface: Color(scheme.onSurface),
surfaceVariant:
Color.alphaBlend(Color(scheme.primary).withOpacity(0.5), Color(scheme.background)),
surfaceVariant: Color.alphaBlend(
Color(scheme.primary).withOpacity(0.5),
Color(scheme.background),
),
onSurfaceVariant: Color(scheme.onSurfaceVariant),
);
}