From b976d30ab294fe75491b68460404dabd80bc1c5f Mon Sep 17 00:00:00 2001 From: ashilkn Date: Thu, 28 Mar 2024 20:37:27 +0530 Subject: [PATCH] fix colours in new material 3 toggle switch --- mobile/lib/ui/components/toggle_switch_widget.dart | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mobile/lib/ui/components/toggle_switch_widget.dart b/mobile/lib/ui/components/toggle_switch_widget.dart index 33477ae9b3..9d1de15395 100644 --- a/mobile/lib/ui/components/toggle_switch_widget.dart +++ b/mobile/lib/ui/components/toggle_switch_widget.dart @@ -25,8 +25,8 @@ class _ToggleSwitchWidgetState extends State { @override void initState() { - toggleValue = widget.value.call(); super.initState(); + toggleValue = widget.value.call(); } @override @@ -50,8 +50,13 @@ class _ToggleSwitchWidgetState extends State { child: FittedBox( fit: BoxFit.contain, child: Switch.adaptive( - activeColor: enteColorScheme.primary400, - inactiveTrackColor: enteColorScheme.fillMuted, + inactiveTrackColor: Colors.transparent, + activeTrackColor: enteColorScheme.primary500, + activeColor: Colors.white, + inactiveThumbColor: enteColorScheme.primary500, + trackOutlineColor: MaterialStateColor.resolveWith( + (states) => enteColorScheme.primary500, + ), materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, value: toggleValue ?? false, onChanged: (negationOfToggleValue) async {