diff --git a/packages/mirai/lib/src/parsers/mirai_color_scheme/mirai_color_scheme.dart b/packages/mirai/lib/src/parsers/mirai_color_scheme/mirai_color_scheme.dart index 3ca94fad..f6cb3fc8 100644 --- a/packages/mirai/lib/src/parsers/mirai_color_scheme/mirai_color_scheme.dart +++ b/packages/mirai/lib/src/parsers/mirai_color_scheme/mirai_color_scheme.dart @@ -65,11 +65,9 @@ extension MiraiColorSchemeParser on MiraiColorScheme { onError: onError.toColor(context)!, errorContainer: errorContainer.toColor(context), onErrorContainer: onErrorContainer.toColor(context), - background: background.toColor(context)!, - onBackground: onBackground.toColor(context)!, surface: surface.toColor(context)!, onSurface: onSurface.toColor(context)!, - surfaceVariant: surfaceVariant.toColor(context), + surfaceContainerHighest: surfaceVariant.toColor(context), onSurfaceVariant: onSurfaceVariant.toColor(context), outline: outline.toColor(context), outlineVariant: outlineVariant.toColor(context), diff --git a/packages/mirai/lib/src/parsers/mirai_switch/mirai_switch_parser.dart b/packages/mirai/lib/src/parsers/mirai_switch/mirai_switch_parser.dart index 3d2b9ce4..21729219 100644 --- a/packages/mirai/lib/src/parsers/mirai_switch/mirai_switch_parser.dart +++ b/packages/mirai/lib/src/parsers/mirai_switch/mirai_switch_parser.dart @@ -76,8 +76,8 @@ class _SwitchWidgetState extends State<_SwitchWidget> { return CupertinoSwitch( value: isSelected, onChanged: _onChanged, - activeColor: model.activeColor.toColor(context), - trackColor: model.trackColor?.parse(context), + activeTrackColor: model.activeColor.toColor(context), + inactiveTrackColor: model.trackColor?.parse(context), thumbColor: model.thumbColor?.parse(context), applyTheme: model.applyTheme, focusColor: model.focusColor?.toColor(context), diff --git a/packages/mirai/lib/src/utils/color_utils.dart b/packages/mirai/lib/src/utils/color_utils.dart index 3893b367..1079f795 100644 --- a/packages/mirai/lib/src/utils/color_utils.dart +++ b/packages/mirai/lib/src/utils/color_utils.dart @@ -39,15 +39,15 @@ extension ColorExt on String? { case ColorType.onErrorContainer: return Theme.of(context).colorScheme.onErrorContainer; case ColorType.background: - return Theme.of(context).colorScheme.background; + return Theme.of(context).colorScheme.surface; case ColorType.onBackground: - return Theme.of(context).colorScheme.onBackground; + return Theme.of(context).colorScheme.onSurface; case ColorType.surface: return Theme.of(context).colorScheme.surface; case ColorType.onSurface: return Theme.of(context).colorScheme.onSurface; case ColorType.surfaceVariant: - return Theme.of(context).colorScheme.surfaceVariant; + return Theme.of(context).colorScheme.surfaceContainerHighest; case ColorType.onSurfaceVariant: return Theme.of(context).colorScheme.onSurfaceVariant; case ColorType.outline: