Skip to content

Commit

Permalink
Fixed Enabled/disabled color of toggles are misleading #178
Browse files Browse the repository at this point in the history
  • Loading branch information
anandnet authored and weblate committed Apr 6, 2024
1 parent 5d24bdc commit 54e44cb
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion lib/ui/utils/theme_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,15 @@ class ThemeController extends GetxController {
letterSpacing: 1,
fontWeight: FontWeight.bold),
),
switchTheme: SwitchThemeData(
thumbColor: MaterialStateProperty.resolveWith<Color>(
(Set<MaterialState> states) {
if (states.contains(MaterialState.selected)) {
return primarySwatch[100]!.withLightness(50);
}
return Colors.white.withOpacity(0.3);
}),
),
indicatorColor: Colors.white,
progressIndicatorTheme: ProgressIndicatorThemeData(
linearTrackColor: (primarySwatch[300])!.computeLuminance() > 0.3
Expand Down Expand Up @@ -215,6 +224,15 @@ class ThemeController extends GetxController {
valueIndicatorColor: Colors.black38,
thumbColor: Colors.white,
),
switchTheme: SwitchThemeData(
thumbColor: MaterialStateProperty.resolveWith<Color>(
(Set<MaterialState> states) {
if (states.contains(MaterialState.selected)) {
return Colors.white.withLightness(50);
}
return Colors.white.withOpacity(0.3);
}),
),
inputDecorationTheme: const InputDecorationTheme(
focusColor: Colors.white,
focusedBorder: UnderlineInputBorder(
Expand Down Expand Up @@ -273,7 +291,7 @@ class ThemeController extends GetxController {
color: Colors.grey[800], fontWeight: FontWeight.bold)),
bottomSheetTheme: const BottomSheetThemeData(
backgroundColor: Colors.white, modalBarrierColor: Colors.white),
sliderTheme: SliderThemeData(
sliderTheme:SliderThemeData(
//base bar color
inactiveTrackColor: Colors.black38,
//buffered progress
Expand All @@ -282,6 +300,15 @@ class ThemeController extends GetxController {
valueIndicatorColor: Colors.white38,
thumbColor: Colors.grey[800],
),
switchTheme: SwitchThemeData(
thumbColor: MaterialStateProperty.resolveWith<Color>(
(Set<MaterialState> states) {
if (states.contains(MaterialState.selected)) {
return Colors.white.withLightness(50);
}
return Colors.grey.withOpacity(0.3);
}),
),
inputDecorationTheme: const InputDecorationTheme(
focusColor: Colors.black,
focusedBorder: UnderlineInputBorder(
Expand Down

0 comments on commit 54e44cb

Please sign in to comment.