diff --git a/CHANGELOG.md b/CHANGELOG.md index e48d971a..d74dd23b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ - **FEAT**: New `ShadTimePicker` and `ShadDatePickerFormField` components. +- **CHORE**: Set minimum Flutter version to `3.24.0` +- **CHORE**: Remove `trackColor` from `ShadSwitch` (thanks to @RaghavTheGreat) + ## 0.15.3 - **FIX**: `ShadDialog` and `ShadSheet` children constraints. diff --git a/lib/src/components/form/fields/switch.dart b/lib/src/components/form/fields/switch.dart index 1e90006c..e4d51684 100644 --- a/lib/src/components/form/fields/switch.dart +++ b/lib/src/components/form/fields/switch.dart @@ -23,7 +23,6 @@ class ShadSwitchFormField extends ShadFormBuilderField { super.focusNode, String? Function(bool)? validator, Color? thumbColor, - Color? trackColor, Color? uncheckedTrackColor, Color? checkedTrackColor, double? width, @@ -64,7 +63,6 @@ class ShadSwitchFormField extends ShadFormBuilderField { width: width, margin: margin, thumbColor: thumbColor, - trackColor: trackColor, uncheckedTrackColor: uncheckedTrackColor, checkedTrackColor: checkedTrackColor, ); diff --git a/lib/src/components/switch.dart b/lib/src/components/switch.dart index c70b9f33..662218f2 100644 --- a/lib/src/components/switch.dart +++ b/lib/src/components/switch.dart @@ -15,7 +15,6 @@ class ShadSwitch extends StatefulWidget { this.onChanged, this.focusNode, this.thumbColor, - this.trackColor, this.uncheckedTrackColor, this.checkedTrackColor, this.width, @@ -44,9 +43,6 @@ class ShadSwitch extends StatefulWidget { /// The color of the switch thumb. final Color? thumbColor; - /// The color of the switch track. - final Color? trackColor; - /// The color of the unchecked track. final Color? uncheckedTrackColor; diff --git a/lib/src/theme/components/switch.dart b/lib/src/theme/components/switch.dart index aa408e1a..2a03fffa 100644 --- a/lib/src/theme/components/switch.dart +++ b/lib/src/theme/components/switch.dart @@ -8,7 +8,6 @@ class ShadSwitchTheme { const ShadSwitchTheme({ this.merge = true, this.thumbColor, - this.trackColor, this.uncheckedTrackColor, this.checkedTrackColor, this.width, @@ -23,8 +22,6 @@ class ShadSwitchTheme { final Color? thumbColor; - final Color? trackColor; - final Color? uncheckedTrackColor; final Color? checkedTrackColor; @@ -50,7 +47,6 @@ class ShadSwitchTheme { return ShadSwitchTheme( merge: b.merge, thumbColor: Color.lerp(a.thumbColor, b.thumbColor, t), - trackColor: Color.lerp(a.trackColor, b.trackColor, t), uncheckedTrackColor: Color.lerp(a.uncheckedTrackColor, b.uncheckedTrackColor, t), checkedTrackColor: @@ -67,7 +63,6 @@ class ShadSwitchTheme { ShadSwitchTheme copyWith({ bool? merge, Color? thumbColor, - Color? trackColor, Color? uncheckedTrackColor, Color? checkedTrackColor, double? width, @@ -80,7 +75,6 @@ class ShadSwitchTheme { return ShadSwitchTheme( merge: merge ?? this.merge, thumbColor: thumbColor ?? this.thumbColor, - trackColor: trackColor ?? this.trackColor, uncheckedTrackColor: uncheckedTrackColor ?? this.uncheckedTrackColor, checkedTrackColor: checkedTrackColor ?? this.checkedTrackColor, width: width ?? this.width, @@ -97,7 +91,6 @@ class ShadSwitchTheme { if (!other.merge) return other; return copyWith( thumbColor: other.thumbColor, - trackColor: other.trackColor, uncheckedTrackColor: other.uncheckedTrackColor, checkedTrackColor: other.checkedTrackColor, width: other.width, @@ -116,7 +109,6 @@ class ShadSwitchTheme { return other is ShadSwitchTheme && other.merge == merge && other.thumbColor == thumbColor && - other.trackColor == trackColor && other.uncheckedTrackColor == uncheckedTrackColor && other.checkedTrackColor == checkedTrackColor && other.width == width && @@ -131,7 +123,6 @@ class ShadSwitchTheme { int get hashCode { return merge.hashCode ^ thumbColor.hashCode ^ - trackColor.hashCode ^ uncheckedTrackColor.hashCode ^ checkedTrackColor.hashCode ^ width.hashCode ^ diff --git a/pubspec.yaml b/pubspec.yaml index e17dfa1e..3ca65490 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,7 +12,7 @@ topics: environment: sdk: ^3.0.0 - flutter: ">=1.17.0" + flutter: ">=3.24.0" dependencies: collection: ^1.18.0