Skip to content

Commit 46c7d53

Browse files
authored
Merge pull request #359 from AhmedLSayed9/update_build_ci_to_run_on_stable_and_master
Update CI workflow to run on stable
2 parents 95c0ec5 + 8fd3109 commit 46c7d53

16 files changed

+50
-46
lines changed

.github/workflows/build.yml

+8-3
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,20 @@ jobs:
1313
build:
1414
name: Run flutter test and analyze
1515
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
channel:
19+
- stable
20+
# We'll add master after migrating to Melos 7.x.x and flutter workspaces
21+
# - master
1622
steps:
1723
- name: Checkout repository
1824
uses: actions/checkout@v4
1925

2026
- name: Setup Flutter environment
21-
uses: subosito/flutter-action@v2
27+
uses: subosito/flutter-action@v2.7.1
2228
with:
23-
channel: stable
24-
flutter-version-file: pubspec.yaml # path to pubspec.yaml
29+
channel: ${{ matrix.channel }}
2530

2631
- name: Set environment paths
2732
run: |

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ customize to your needs.
103103
| [padding](https://pub.dev/documentation/dropdown_button2/latest/dropdown_button2/ButtonStyleData/padding.html) | The inner padding of the Button | EdgeInsetsGeometry | No |
104104
| [decoration](https://pub.dev/documentation/dropdown_button2/latest/dropdown_button2/ButtonStyleData/decoration.html) | The decoration of the Button | BoxDecoration | No |
105105
| [elevation](https://pub.dev/documentation/dropdown_button2/latest/dropdown_button2/ButtonStyleData/elevation.html) | The elevation of the Button | int | No |
106-
| [overlayColor](https://pub.dev/documentation/dropdown_button2/latest/dropdown_button2/ButtonStyleData/overlayColor.html) | Defines the ink response focus, hover, and splash colors for the button | MaterialStateProperty<Color?> | No |
106+
| [overlayColor](https://pub.dev/documentation/dropdown_button2/latest/dropdown_button2/ButtonStyleData/overlayColor.html) | Defines the ink response focus, hover, and splash colors for the button | WidgetStateProperty<Color?> | No |
107107

108108
#### Subclass IconStyleData:
109109

@@ -141,7 +141,7 @@ customize to your needs.
141141
| [padding](https://pub.dev/documentation/dropdown_button2/latest/dropdown_button2/MenuItemStyleData/padding.html) | The padding of menu items | EdgeInsetsGeometry | No |
142142
| [useDecorationHorizontalPadding](https://pub.dev/documentation/dropdown_button2/latest/dropdown_button2/MenuItemStyleData/useDecorationHorizontalPadding.html) | Determine whether to use the horizontal padding from "decoration.contentPadding" for menu items when using `DropdownButtonFormField2` | bool | No |
143143
| [borderRadius](https://pub.dev/documentation/dropdown_button2/latest/dropdown_button2/MenuItemStyleData/borderRadius.html) | The border radius of the menu item | BorderRadius | No |
144-
| [overlayColor](https://pub.dev/documentation/dropdown_button2/latest/dropdown_button2/MenuItemStyleData/overlayColor.html) | Defines the ink response focus, hover, and splash colors for the items | MaterialStateProperty<Color?> | No |
144+
| [overlayColor](https://pub.dev/documentation/dropdown_button2/latest/dropdown_button2/MenuItemStyleData/overlayColor.html) | Defines the ink response focus, hover, and splash colors for the items | WidgetStateProperty<Color?> | No |
145145
| [selectedMenuItemBuilder](https://pub.dev/documentation/dropdown_button2/latest/dropdown_button2/MenuItemStyleData/selectedMenuItemBuilder.html) | A builder to customize the selected menu item | SelectedMenuItemBuilder | No |
146146

147147
#### Subclass DropdownSearchData:
@@ -334,8 +334,8 @@ Widget build(BuildContext context) {
334334
offset: const Offset(-20, 0),
335335
scrollbarTheme: ScrollbarThemeData(
336336
radius: const Radius.circular(40),
337-
thickness: MaterialStateProperty.all(6),
338-
thumbVisibility: MaterialStateProperty.all(true),
337+
thickness: WidgetStateProperty.all(6),
338+
thumbVisibility: WidgetStateProperty.all(true),
339339
),
340340
),
341341
menuItemStyleData: const MenuItemStyleData(
@@ -1151,10 +1151,10 @@ class CustomDropdownButton2 extends StatelessWidget {
11511151
scrollbarTheme: ScrollbarThemeData(
11521152
radius: scrollbarRadius ?? const Radius.circular(40),
11531153
thickness: scrollbarThickness != null
1154-
? MaterialStateProperty.all<double>(scrollbarThickness!)
1154+
? WidgetStateProperty.all<double>(scrollbarThickness!)
11551155
: null,
11561156
thumbVisibility: scrollbarAlwaysShow != null
1157-
? MaterialStateProperty.all<bool>(scrollbarAlwaysShow!)
1157+
? WidgetStateProperty.all<bool>(scrollbarAlwaysShow!)
11581158
: null,
11591159
),
11601160
),

analysis_options.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ linter:
119119
# - one_member_abstracts # too many false positives
120120
- only_throw_errors # this does get disabled in a few places where we have legacy code that uses strings et al
121121
- overridden_fields
122-
- package_api_docs
123122
- package_names
124123
- package_prefixed_library_names
125124
# - parameter_assignments # we do this commonly
@@ -202,7 +201,6 @@ linter:
202201
- unnecessary_this
203202
- unnecessary_to_list_in_spreads
204203
- unrelated_type_equality_checks
205-
- unsafe_html
206204
- use_build_context_synchronously
207205
# - use_colored_box # not yet tested
208206
# - use_decorated_box # not yet tested

melos.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ command:
1313
{new_package_versions}
1414
bootstrap:
1515
environment:
16-
sdk: ">=3.2.0 <4.0.0"
17-
flutter: ">=3.16.0"
16+
sdk: ">=3.4.0 <4.0.0"
17+
flutter: ">=3.22.0"
1818

1919
scripts:
2020
lint:all:

packages/dropdown_button2/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- Support helperStyle/helperMaxLines/errorMaxLines for DropdownButtonFormField2.
1212
- Add `MenuItemStyleData.useDecorationHorizontalPadding`, used to determine whether to use the horizontal padding from "decoration.contentPadding" for menu items when using `DropdownButtonFormField2`.
1313
- Use decoration hint text as the default value for dropdown button hints [Flutter core].
14+
- Update SDK constraints: ">=3.4.0 <4.0.0"
1415

1516
## 3.0.0-beta.21
1617

packages/dropdown_button2/example/custom_dropdown_button2.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ class CustomDropdownButton2 extends StatelessWidget {
131131
scrollbarTheme: ScrollbarThemeData(
132132
radius: scrollbarRadius ?? const Radius.circular(40),
133133
thickness: scrollbarThickness != null
134-
? MaterialStateProperty.all<double>(scrollbarThickness!)
134+
? WidgetStateProperty.all<double>(scrollbarThickness!)
135135
: null,
136136
thumbVisibility: scrollbarAlwaysShow != null
137-
? MaterialStateProperty.all<bool>(scrollbarAlwaysShow!)
137+
? WidgetStateProperty.all<bool>(scrollbarAlwaysShow!)
138138
: null,
139139
),
140140
),

packages/dropdown_button2/example/example.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ class _MyHomePageState extends State<MyHomePage> {
117117
offset: const Offset(-20, 0),
118118
scrollbarTheme: ScrollbarThemeData(
119119
radius: const Radius.circular(40),
120-
thickness: MaterialStateProperty.all<double>(6),
121-
thumbVisibility: MaterialStateProperty.all<bool>(true),
120+
thickness: WidgetStateProperty.all<double>(6),
121+
thumbVisibility: WidgetStateProperty.all<bool>(true),
122122
),
123123
),
124124
menuItemStyleData: const MenuItemStyleData(

packages/dropdown_button2/lib/src/button_style_data.dart

+6-6
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ class ButtonStyleData extends _ButtonStyleDataBase {
4848
/// This default null property can be used as an alternative to
4949
/// [focusColor], [hoverColor], [highlightColor], and
5050
/// [splashColor]. If non-null, it is resolved against one of
51-
/// [MaterialState.focused], [MaterialState.hovered], and
52-
/// [MaterialState.pressed]. It's convenient to use when the parent
53-
/// widget can pass along its own MaterialStateProperty value for
51+
/// [WidgetState.focused], [WidgetState.hovered], and
52+
/// [WidgetState.pressed]. It's convenient to use when the parent
53+
/// widget can pass along its own WidgetStateProperty value for
5454
/// the overlay color.
5555
///
56-
/// [MaterialState.pressed] triggers a ripple (an ink splash), per
56+
/// [WidgetState.pressed] triggers a ripple (an ink splash), per
5757
/// the current Material Design spec. The [overlayColor] doesn't map
5858
/// a state to [highlightColor] because a separate highlight is not
5959
/// used by the current design guidelines. See
@@ -67,7 +67,7 @@ class ButtonStyleData extends _ButtonStyleDataBase {
6767
/// * The Material Design specification for overlay colors and how they
6868
/// match a component's state:
6969
/// <https://material.io/design/interaction/states.html#anatomy>.
70-
final MaterialStateProperty<Color?>? overlayColor;
70+
final WidgetStateProperty<Color?>? overlayColor;
7171

7272
/// Create a clone of the current [ButtonStyleData] but with the provided
7373
/// parameters overridden.
@@ -78,7 +78,7 @@ class ButtonStyleData extends _ButtonStyleDataBase {
7878
BoxDecoration? decoration,
7979
BoxDecoration? foregroundDecoration,
8080
int? elevation,
81-
MaterialStateProperty<Color?>? overlayColor,
81+
WidgetStateProperty<Color?>? overlayColor,
8282
}) {
8383
return ButtonStyleData(
8484
height: height ?? this.height,

packages/dropdown_button2/lib/src/dropdown_button2.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -877,10 +877,10 @@ class _DropdownButton2State<T> extends State<DropdownButton2<T>>
877877
}
878878

879879
final MouseCursor effectiveMouseCursor =
880-
MaterialStateProperty.resolveAs<MouseCursor>(
881-
MaterialStateMouseCursor.clickable,
882-
<MaterialState>{
883-
if (!_enabled) MaterialState.disabled,
880+
WidgetStateProperty.resolveAs<MouseCursor>(
881+
WidgetStateMouseCursor.clickable,
882+
<WidgetState>{
883+
if (!_enabled) WidgetState.disabled,
884884
},
885885
);
886886

packages/dropdown_button2/lib/src/dropdown_menu.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ class _DropdownMenuState<T> extends State<_DropdownMenu<T>> {
116116
super.dispose();
117117
}
118118

119-
final _states = <MaterialState>{
120-
MaterialState.dragged,
121-
MaterialState.hovered,
119+
final _states = <WidgetState>{
120+
WidgetState.dragged,
121+
WidgetState.hovered,
122122
};
123123

124124
bool get _isIOS => Theme.of(context).platform == TargetPlatform.iOS;

packages/dropdown_button2/lib/src/dropdown_route.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ class _CustomModalBarrierState extends State<_CustomModalBarrier> {
490490
super.initState();
491491
color = widget.animation!.drive(
492492
ColorTween(
493-
begin: widget.barrierColor?.withOpacity(0.0),
493+
begin: widget.barrierColor?.withValues(alpha: 0.0),
494494
end: widget.barrierColor,
495495
).chain(CurveTween(curve: widget.barrierCurve)),
496496
);

packages/dropdown_button2/lib/src/dropdown_style_data.dart

+6-6
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,12 @@ class MenuItemStyleData {
180180
/// This default null property can be used as an alternative to
181181
/// [focusColor], [hoverColor], [highlightColor], and
182182
/// [splashColor]. If non-null, it is resolved against one of
183-
/// [MaterialState.focused], [MaterialState.hovered], and
184-
/// [MaterialState.pressed]. It's convenient to use when the parent
185-
/// widget can pass along its own MaterialStateProperty value for
183+
/// [WidgetState.focused], [WidgetState.hovered], and
184+
/// [WidgetState.pressed]. It's convenient to use when the parent
185+
/// widget can pass along its own WidgetStateProperty value for
186186
/// the overlay color.
187187
///
188-
/// [MaterialState.pressed] triggers a ripple (an ink splash), per
188+
/// [WidgetState.pressed] triggers a ripple (an ink splash), per
189189
/// the current Material Design spec. The [overlayColor] doesn't map
190190
/// a state to [highlightColor] because a separate highlight is not
191191
/// used by the current design guidelines. See
@@ -199,7 +199,7 @@ class MenuItemStyleData {
199199
/// * The Material Design specification for overlay colors and how they
200200
/// match a component's state:
201201
/// <https://material.io/design/interaction/states.html#anatomy>.
202-
final MaterialStateProperty<Color?>? overlayColor;
202+
final WidgetStateProperty<Color?>? overlayColor;
203203

204204
/// A builder to customize the selected menu item.
205205
///
@@ -222,7 +222,7 @@ class MenuItemStyleData {
222222
MenuItemStyleData copyWith({
223223
EdgeInsetsGeometry? padding,
224224
BorderRadius? borderRadius,
225-
MaterialStateProperty<Color?>? overlayColor,
225+
WidgetStateProperty<Color?>? overlayColor,
226226
SelectedMenuItemBuilder? selectedMenuItemBuilder,
227227
}) {
228228
return MenuItemStyleData(

packages/dropdown_button2/pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ repository: https://github.com/AhmedLSayed9/dropdown_button2
55
issue_tracker: https://github.com/AhmedLSayed9/dropdown_button2/issues
66

77
environment:
8-
sdk: ">=3.2.0 <4.0.0"
9-
flutter: ">=3.16.0"
8+
sdk: ">=3.4.0 <4.0.0"
9+
flutter: ">=3.22.0"
1010

1111
dependencies:
1212
flutter:

packages/dropdown_button2_test/lib/src/few_styling_example.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ class _FewStylingExampleState extends State<FewStylingExample> {
101101
offset: const Offset(-20, 0),
102102
scrollbarTheme: ScrollbarThemeData(
103103
radius: const Radius.circular(40),
104-
thickness: MaterialStateProperty.all(6),
105-
thumbVisibility: MaterialStateProperty.all(true),
104+
thickness: WidgetStateProperty.all(6),
105+
thumbVisibility: WidgetStateProperty.all(true),
106106
),
107107
),
108108
menuItemStyleData: const MenuItemStyleData(

packages/dropdown_button2_test/pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: dropdown_button2_test
22
publish_to: none
33

44
environment:
5-
sdk: ">=3.2.0 <4.0.0"
6-
flutter: ">=3.16.0"
5+
sdk: ">=3.4.0 <4.0.0"
6+
flutter: ">=3.22.0"
77

88
dependencies:
99
flutter:

pubspec.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: dropdown_button2_workspace
22
publish_to: "none"
33

44
environment:
5-
sdk: ">=3.2.0 <4.0.0"
6-
flutter: 3.16.0
5+
sdk: ">=3.4.0 <4.0.0"
6+
flutter: ">=3.22.0"
77

88
dev_dependencies:
99
flutter_lints: ^4.0.0
10-
melos: ^6.0.0
10+
melos: ^6.3.2

0 commit comments

Comments
 (0)