diff --git a/lib/src/widgets/animated_toggle_switch.dart b/lib/src/widgets/animated_toggle_switch.dart index 7a06803..0b1311f 100644 --- a/lib/src/widgets/animated_toggle_switch.dart +++ b/lib/src/widgets/animated_toggle_switch.dart @@ -1114,7 +1114,9 @@ class AnimatedToggleSwitch _BaseToggleStyle._lerpFunction(styleAnimationType), (style) => DecoratedBox( decoration: BoxDecoration( - color: style._backgroundColor?.value, + color: style._backgroundGradient != null + ? null + : style._backgroundColor?.value, gradient: style._backgroundGradient?.value, borderRadius: style._borderRadius?.value, boxShadow: style._boxShadow?.value, @@ -1272,7 +1274,9 @@ class AnimatedToggleSwitch return DecoratedBox( key: AnimatedToggleSwitchTestKeys.indicatorDecoratedBoxKey, decoration: BoxDecoration( - color: style._indicatorColor?.value, + color: style._indicatorGradient != null + ? null + : style._indicatorColor?.value, gradient: style._indicatorGradient?.value, borderRadius: style._indicatorBorderRadius?.value, border: style._indicatorBorder?.value,