From 5a98f93a830da3d179f93507be40e5865968ce9d Mon Sep 17 00:00:00 2001 From: Raghav Joshi <28825619+RaghavTheGreat1@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:55:41 +0530 Subject: [PATCH 1/2] chore: remove unnecessary track color in switch (#194) --- lib/src/components/form/fields/switch.dart | 2 -- lib/src/components/switch.dart | 4 ---- lib/src/theme/components/switch.dart | 9 --------- 3 files changed, 15 deletions(-) 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 ^ From 9cdf9c92a0cc23ddbc5be96f4a1c3ee4c730ff98 Mon Sep 17 00:00:00 2001 From: Alexandru Mariuti Date: Fri, 15 Nov 2024 16:08:43 +0100 Subject: [PATCH 2/2] bump version to 0.15.4 --- CHANGELOG.md | 5 +++++ pubspec.yaml | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47572b6e..7657972a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.15.4 + +- **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/pubspec.yaml b/pubspec.yaml index e262766b..cdf23f95 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: shadcn_ui description: shadcn-ui ported in Flutter. Awesome UI components for Flutter, fully customizable. -version: 0.15.3 +version: 0.15.4 homepage: https://flutter-shadcn-ui.mariuti.com repository: https://github.com/nank1ro/flutter-shadcn-ui documentation: https://flutter-shadcn-ui.mariuti.com @@ -12,7 +12,7 @@ topics: environment: sdk: ^3.0.0 - flutter: ">=1.17.0" + flutter: ">=3.24.0" dependencies: collection: ^1.18.0