Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/dropdown_button2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- Update SDK constraints: ">=3.4.0 <4.0.0"
- Fix DropdownButtonFormField clips text when large text scale is used [Flutter core].
- Fix DropdownButtonFormField padding when ButtonTheme.alignedDropdown is true [Flutter core].
- Add barrierCoversButton to DropdownButtonFormField2.

## 3.0.0-beta.21

Expand Down
60 changes: 31 additions & 29 deletions packages/dropdown_button2/lib/src/dropdown_button2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ class DropdownButton2<T> extends StatefulWidget {
this.customButton,
this.openWithLongPress = false,
this.barrierDismissible = true,
this.barrierCoversButton = true,
this.barrierColor,
this.barrierLabel,
this.barrierCoversButton = true,
this.openDropdownListenable,
// When adding new arguments, consider adding similar arguments to
// DropdownButtonFormField.
Expand All @@ -132,37 +132,37 @@ class DropdownButton2<T> extends StatefulWidget {
const DropdownButton2._formField({
super.key,
required this.items,
this.selectedItemBuilder,
required this.selectedItemBuilder,
required this.valueListenable,
required this.multiValueListenable,
this.hint,
this.disabledHint,
required this.hint,
required this.disabledHint,
required this.onChanged,
this.onMenuStateChange,
this.style,
this.underline,
this.isDense = false,
this.isExpanded = false,
this.focusNode,
this.autofocus = false,
this.enableFeedback,
this.alignment = AlignmentDirectional.centerStart,
this.buttonStyleData,
required this.onMenuStateChange,
required this.style,
required this.isDense,
required this.isExpanded,
required this.focusNode,
required this.autofocus,
required this.enableFeedback,
required this.alignment,
required this.buttonStyleData,
required this.iconStyleData,
required this.dropdownStyleData,
required this.menuItemStyleData,
this.dropdownSearchData,
this.dropdownSeparator,
this.customButton,
this.openWithLongPress = false,
this.barrierDismissible = true,
this.barrierColor,
this.barrierCoversButton = true,
this.barrierLabel,
this.openDropdownListenable,
required this.dropdownSearchData,
required this.dropdownSeparator,
required this.customButton,
required this.openWithLongPress,
required this.barrierDismissible,
required this.barrierCoversButton,
required this.barrierColor,
required this.barrierLabel,
required this.openDropdownListenable,
required InputDecoration inputDecoration,
required bool isEmpty,
}) : _inputDecoration = inputDecoration,
}) : underline = null,
_inputDecoration = inputDecoration,
_isEmpty = isEmpty;

/// The list of items the user can select.
Expand Down Expand Up @@ -338,6 +338,11 @@ class DropdownButton2<T> extends StatefulWidget {
/// Whether you can dismiss this route by tapping the modal barrier.
final bool barrierDismissible;

/// Specifies whether the modal barrier should cover the dropdown button or not.
///
/// Defaults to true.
final bool barrierCoversButton;

/// The color to use for the modal barrier. If this is null, the barrier will
/// be transparent.
final Color? barrierColor;
Expand All @@ -348,11 +353,6 @@ class DropdownButton2<T> extends StatefulWidget {
/// accessibility tools (like VoiceOver on iOS) focus on the barrier.
final String? barrierLabel;

/// Specifies whether the modal barrier should cover the dropdown button or not.
///
/// Defaults to true.
final bool barrierCoversButton;

/// A [Listenable] that can be used to programmatically open the dropdown menu.
///
/// The [openDropdownListenable] allows you to manually open the dropdown by modifying its value.
Expand Down Expand Up @@ -985,6 +985,7 @@ class DropdownButtonFormField2<T> extends FormField<T> {
Widget? customButton,
bool openWithLongPress = false,
bool barrierDismissible = true,
bool barrierCoversButton = true,
Color? barrierColor,
String? barrierLabel,
Listenable? openDropdownListenable,
Expand Down Expand Up @@ -1056,6 +1057,7 @@ class DropdownButtonFormField2<T> extends FormField<T> {
customButton: customButton,
openWithLongPress: openWithLongPress,
barrierDismissible: barrierDismissible,
barrierCoversButton: barrierCoversButton,
barrierColor: barrierColor,
barrierLabel: barrierLabel,
openDropdownListenable: openDropdownListenable,
Expand Down
Loading