Skip to content

Commit 4a29817

Browse files
committed
Add barrierCoversButton to DropdownButtonFormField2
1 parent 1764b63 commit 4a29817

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

packages/dropdown_button2/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- Update SDK constraints: ">=3.4.0 <4.0.0"
1515
- Fix DropdownButtonFormField clips text when large text scale is used [Flutter core].
1616
- Fix DropdownButtonFormField padding when ButtonTheme.alignedDropdown is true [Flutter core].
17+
- Add barrierCoversButton to DropdownButtonFormField2.
1718

1819
## 3.0.0-beta.21
1920

packages/dropdown_button2/lib/src/dropdown_button2.dart

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ class DropdownButton2<T> extends StatefulWidget {
116116
this.customButton,
117117
this.openWithLongPress = false,
118118
this.barrierDismissible = true,
119+
this.barrierCoversButton = true,
119120
this.barrierColor,
120121
this.barrierLabel,
121-
this.barrierCoversButton = true,
122122
this.openDropdownListenable,
123123
// When adding new arguments, consider adding similar arguments to
124124
// DropdownButtonFormField.
@@ -155,8 +155,8 @@ class DropdownButton2<T> extends StatefulWidget {
155155
required this.customButton,
156156
required this.openWithLongPress,
157157
required this.barrierDismissible,
158+
required this.barrierCoversButton,
158159
required this.barrierColor,
159-
this.barrierCoversButton = true,
160160
required this.barrierLabel,
161161
required this.openDropdownListenable,
162162
required InputDecoration inputDecoration,
@@ -338,6 +338,11 @@ class DropdownButton2<T> extends StatefulWidget {
338338
/// Whether you can dismiss this route by tapping the modal barrier.
339339
final bool barrierDismissible;
340340

341+
/// Specifies whether the modal barrier should cover the dropdown button or not.
342+
///
343+
/// Defaults to true.
344+
final bool barrierCoversButton;
345+
341346
/// The color to use for the modal barrier. If this is null, the barrier will
342347
/// be transparent.
343348
final Color? barrierColor;
@@ -348,11 +353,6 @@ class DropdownButton2<T> extends StatefulWidget {
348353
/// accessibility tools (like VoiceOver on iOS) focus on the barrier.
349354
final String? barrierLabel;
350355

351-
/// Specifies whether the modal barrier should cover the dropdown button or not.
352-
///
353-
/// Defaults to true.
354-
final bool barrierCoversButton;
355-
356356
/// A [Listenable] that can be used to programmatically open the dropdown menu.
357357
///
358358
/// The [openDropdownListenable] allows you to manually open the dropdown by modifying its value.
@@ -985,6 +985,7 @@ class DropdownButtonFormField2<T> extends FormField<T> {
985985
Widget? customButton,
986986
bool openWithLongPress = false,
987987
bool barrierDismissible = true,
988+
bool barrierCoversButton = true,
988989
Color? barrierColor,
989990
String? barrierLabel,
990991
Listenable? openDropdownListenable,
@@ -1056,6 +1057,7 @@ class DropdownButtonFormField2<T> extends FormField<T> {
10561057
customButton: customButton,
10571058
openWithLongPress: openWithLongPress,
10581059
barrierDismissible: barrierDismissible,
1060+
barrierCoversButton: barrierCoversButton,
10591061
barrierColor: barrierColor,
10601062
barrierLabel: barrierLabel,
10611063
openDropdownListenable: openDropdownListenable,

0 commit comments

Comments
 (0)