Skip to content

Commit

Permalink
Merge branch 'main' into feat/time-picker
Browse files Browse the repository at this point in the history
  • Loading branch information
nank1ro authored Nov 17, 2024
2 parents 9d4934e + 9cdf9c9 commit 8ab50f0
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 16 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions lib/src/components/form/fields/switch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class ShadSwitchFormField extends ShadFormBuilderField<bool> {
super.focusNode,
String? Function(bool)? validator,
Color? thumbColor,
Color? trackColor,
Color? uncheckedTrackColor,
Color? checkedTrackColor,
double? width,
Expand Down Expand Up @@ -64,7 +63,6 @@ class ShadSwitchFormField extends ShadFormBuilderField<bool> {
width: width,
margin: margin,
thumbColor: thumbColor,
trackColor: trackColor,
uncheckedTrackColor: uncheckedTrackColor,
checkedTrackColor: checkedTrackColor,
);
Expand Down
4 changes: 0 additions & 4 deletions lib/src/components/switch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class ShadSwitch extends StatefulWidget {
this.onChanged,
this.focusNode,
this.thumbColor,
this.trackColor,
this.uncheckedTrackColor,
this.checkedTrackColor,
this.width,
Expand Down Expand Up @@ -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;

Expand Down
9 changes: 0 additions & 9 deletions lib/src/theme/components/switch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class ShadSwitchTheme {
const ShadSwitchTheme({
this.merge = true,
this.thumbColor,
this.trackColor,
this.uncheckedTrackColor,
this.checkedTrackColor,
this.width,
Expand All @@ -23,8 +22,6 @@ class ShadSwitchTheme {

final Color? thumbColor;

final Color? trackColor;

final Color? uncheckedTrackColor;

final Color? checkedTrackColor;
Expand All @@ -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:
Expand All @@ -67,7 +63,6 @@ class ShadSwitchTheme {
ShadSwitchTheme copyWith({
bool? merge,
Color? thumbColor,
Color? trackColor,
Color? uncheckedTrackColor,
Color? checkedTrackColor,
double? width,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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 &&
Expand All @@ -131,7 +123,6 @@ class ShadSwitchTheme {
int get hashCode {
return merge.hashCode ^
thumbColor.hashCode ^
trackColor.hashCode ^
uncheckedTrackColor.hashCode ^
checkedTrackColor.hashCode ^
width.hashCode ^
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ topics:

environment:
sdk: ^3.0.0
flutter: ">=1.17.0"
flutter: ">=3.24.0"

dependencies:
collection: ^1.18.0
Expand Down

0 comments on commit 8ab50f0

Please sign in to comment.