Skip to content

Commit

Permalink
feat: bump minimum supported sdk to 3 22 x (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
smallTrogdor authored Dec 13, 2024
1 parent f253170 commit 4f888ee
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
strategy:
fail-fast: false
matrix:
sdk: ["3.19.6", ""]
sdk: ["3.22.3", ""]
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
strategy:
fail-fast: false
matrix:
sdk: ["3.19.6", ""]
sdk: ["3.22.3", ""]
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ It is expected that you keep this format strictly, since we depend on it in our
### Added
- added `constraints` to `showSBBModalSheet` to allow varying screen sizes (tablet)

### Changed
- Dropped support for `Flutter SDK 3.19.6`: minimum supported version is 3.22.3

### Deprecated
- `SBBIconFormButton`
Expand Down
4 changes: 2 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ publish_to: "none"

environment:
sdk: ">=3.3.0 <4.0.0"
flutter: ">=3.19.0"
flutter: ">=3.22.0"

dependencies:
flutter:
Expand All @@ -25,7 +25,7 @@ dependencies:
flutter_svg: ^2.0.6

# https://pub.dev/packages/intl
intl: ">=0.18.0"
intl: ">=0.19.0"

sbb_design_system_mobile:
path: ../
Expand Down
21 changes: 10 additions & 11 deletions lib/src/theme/sbb_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,38 +111,37 @@ class SBBTheme {
],
);

/// Convenience method for easier use of [MaterialStateProperty.all].
static MaterialStateProperty<T> allStates<T>(T value) {
return MaterialStateProperty.all(value);
/// Convenience method for easier use of [WidgetStateProperty.all].
static WidgetStateProperty<T> allStates<T>(T value) {
return WidgetStateProperty.all(value);
}

/// Convenience method for easier use of [MaterialStateProperty.resolveWith].
static MaterialStateProperty<T?> resolveStatesWith<T>({
/// Convenience method for easier use of [WidgetStateProperty.resolveWith].
static WidgetStateProperty<T?> resolveStatesWith<T>({
required T defaultValue,
T? pressedValue,
T? disabledValue,
T? hoveredValue,
String? parent,
T? selectedValue,
}) {
return MaterialStateProperty.resolveWith((states) {
return WidgetStateProperty.resolveWith((states) {
// disabled
if (states.contains(MaterialState.disabled) && disabledValue != null) {
if (states.contains(WidgetState.disabled) && disabledValue != null) {
return disabledValue;
}

// pressed / focused
if (states.any({MaterialState.pressed, MaterialState.focused}.contains) &&
pressedValue != null) {
if (states.any({WidgetState.pressed, WidgetState.focused}.contains) && pressedValue != null) {
return pressedValue;
}
// hovered
if (states.contains(MaterialState.hovered) && hoveredValue != null) {
if (states.contains(WidgetState.hovered) && hoveredValue != null) {
return hoveredValue;
}

// selected
if (states.contains(MaterialState.selected) && selectedValue != null) {
if (states.contains(WidgetState.selected) && selectedValue != null) {
return selectedValue;
}
// default
Expand Down
2 changes: 1 addition & 1 deletion lib/src/theme/styles/src/sbb_button_styles.dart
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ class SBBButtonStyles extends ThemeExtension<SBBButtonStyles> {
const EdgeInsets.symmetric(horizontal: sbbDefaultSpacing)),
elevation: SBBTheme.allStates(0),
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
mouseCursor: MaterialStateMouseCursor.clickable,
mouseCursor: WidgetStateMouseCursor.clickable,
);

FilledButtonThemeData get filledButtonTheme => FilledButtonThemeData(
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ version: 2.0.0

environment:
sdk: ">=3.3.0 <4.0.0"
flutter: ">=3.19.0"
flutter: ">=3.22.0"

dependencies:
flutter:
Expand Down

0 comments on commit 4f888ee

Please sign in to comment.