fixed scheme mapping and returned to SchemeTonalSpot

This commit is contained in:
Vadim 2024-05-20 16:40:20 +02:00
parent 1bd26e0ff3
commit d268a4f8ae
5 changed files with 36 additions and 33 deletions

View file

@ -73,7 +73,7 @@ ThemeData themeFrom(Color primaryColor, Brightness brightness) {
}
ColorScheme _colorSchemeFromColor(Color primaryColor, Brightness brightness) {
final scheme = SchemeRainbow(
final scheme = SchemeTonalSpot(
sourceColorHct: Hct.fromInt(primaryColor.value),
isDark: brightness == Brightness.dark,
contrastLevel: 0.0,
@ -82,10 +82,10 @@ ColorScheme _colorSchemeFromColor(Color primaryColor, Brightness brightness) {
return ColorScheme(
brightness: brightness,
background: Color(scheme.background),
error: Color(scheme.error),
errorContainer: Color(scheme.errorContainer),
onBackground: Color(scheme.onBackground),
error: Color(scheme.error),
onError: Color(scheme.onError),
errorContainer: Color(scheme.errorContainer),
onErrorContainer: Color(scheme.onErrorContainer),
primary: Color(scheme.primary),
onPrimary: Color(scheme.onPrimary),
@ -93,18 +93,21 @@ ColorScheme _colorSchemeFromColor(Color primaryColor, Brightness brightness) {
onPrimaryContainer: Color(scheme.onPrimaryContainer),
secondary: Color(scheme.secondary),
onSecondary: Color(scheme.onSecondary),
surface: Color.alphaBlend(
Color(scheme.primary).withOpacity(0.05),
Color(scheme.background),
),
secondaryContainer: Color(scheme.secondaryContainer),
onSecondaryContainer: Color(scheme.onSecondaryContainer),
tertiary: Color(scheme.tertiary),
onTertiary: Color(scheme.onTertiary),
tertiaryContainer: Color(scheme.tertiaryContainer),
onTertiaryContainer: Color(scheme.onTertiaryContainer),
surface: Color(scheme.surface),
onSurface: Color(scheme.onSurface),
surfaceVariant: Color.alphaBlend(
Color(scheme.primary).withOpacity(0.5),
Color(scheme.background),
),
surfaceVariant: Color(scheme.surfaceVariant),
onSurfaceVariant: Color(scheme.onSurfaceVariant),
outline: Color(scheme.outline),
outlineVariant: Color(scheme.outlineVariant),
surfaceTint: Color(scheme.surfaceTint),
shadow: Color(scheme.shadow),
scrim: Color(scheme.scrim),
);
}

View file

@ -47,10 +47,11 @@ class ReadingValueContainer extends StatelessWidget implements AnimatedDialogClo
@override
Widget build(BuildContext context) {
return ClipRRect(
return DecoratedBox(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(Dimens.borderRadiusM),
child: ColoredBox(
color: backgroundColor(context),
),
child: Padding(
padding: const EdgeInsets.all(Dimens.paddingM),
child: Stack(
@ -73,7 +74,6 @@ class ReadingValueContainer extends StatelessWidget implements AnimatedDialogClo
],
),
),
),
);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 KiB

After

Width:  |  Height:  |  Size: 498 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 872 KiB

After

Width:  |  Height:  |  Size: 858 KiB