Skip to content

Commit 85ee17d

Browse files
committed
tweak: apply theme to cupertino switches
1 parent d62baa2 commit 85ee17d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/components/theming/adaptive_switch.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ class AdaptiveSwitch extends Switch {
2626
return YaruSwitch(
2727
value: value,
2828
onChanged: onChanged,
29-
thumbColor: thumbColor?.resolve(const {}),
29+
thumbColor: thumbColor?.resolve({
30+
if (value) WidgetState.selected,
31+
if (onChanged == null) WidgetState.disabled,
32+
}),
3033
focusNode: focusNode,
3134
autofocus: autofocus,
3235
mouseCursor: mouseCursor,

lib/components/theming/saber_theme.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'package:flutter/cupertino.dart';
12
import 'package:flutter/material.dart';
23
import 'package:saber/components/theming/font_fallbacks.dart';
34
import 'package:saber/data/prefs.dart';
@@ -41,6 +42,9 @@ abstract class SaberTheme {
4142
year2023: false,
4243
stopIndicatorColor: Colors.transparent,
4344
),
45+
cupertinoOverrideTheme: const NoDefaultCupertinoThemeData(
46+
applyThemeToAll: true,
47+
),
4448
);
4549
}
4650

0 commit comments

Comments
 (0)