mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-23 07:50:42 +00:00
fixed scheme mapping and returned to SchemeTonalSpot
This commit is contained in:
parent
1bd26e0ff3
commit
d268a4f8ae
5 changed files with 36 additions and 33 deletions
|
@ -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),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -47,31 +47,31 @@ class ReadingValueContainer extends StatelessWidget implements AnimatedDialogClo
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ClipRRect(
|
||||
borderRadius: BorderRadius.circular(Dimens.borderRadiusM),
|
||||
child: ColoredBox(
|
||||
return DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(Dimens.borderRadiusM),
|
||||
color: backgroundColor(context),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(Dimens.paddingM),
|
||||
child: Stack(
|
||||
children: [
|
||||
if (locked)
|
||||
Positioned(
|
||||
top: 0,
|
||||
right: 0,
|
||||
child: Icon(
|
||||
Icons.lock_outlined,
|
||||
size: Theme.of(context).textTheme.labelMedium!.fontSize,
|
||||
color: Theme.of(context).colorScheme.onPrimaryContainer,
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(Dimens.paddingM),
|
||||
child: Stack(
|
||||
children: [
|
||||
if (locked)
|
||||
Positioned(
|
||||
top: 0,
|
||||
right: 0,
|
||||
child: Icon(
|
||||
Icons.lock_outlined,
|
||||
size: Theme.of(context).textTheme.labelMedium!.fontSize,
|
||||
color: Theme.of(context).colorScheme.onPrimaryContainer,
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: _items,
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: _items,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
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 |
Loading…
Reference in a new issue