Skip to content

Commit

Permalink
Remove deprecated colors
Browse files Browse the repository at this point in the history
  • Loading branch information
divyanshub024 committed Dec 23, 2024
1 parent 94948d2 commit 54e3da3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
6 changes: 3 additions & 3 deletions packages/mirai/lib/src/utils/color_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 54e3da3

Please sign in to comment.