File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
packages/dropdown_button2/lib/src Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -360,7 +360,6 @@ class _DropdownMenuRouteLayout<T> extends SingleChildLayoutDelegate {
360
360
361
361
@override
362
362
BoxConstraints getConstraintsForChild (BoxConstraints constraints) {
363
- final double ? itemWidth = route.dropdownStyle.width;
364
363
double maxHeight =
365
364
route.getMenuAvailableHeight (availableHeight, mediaQueryPadding);
366
365
final double ? preferredMaxHeight = route.dropdownStyle.maxHeight;
@@ -369,8 +368,9 @@ class _DropdownMenuRouteLayout<T> extends SingleChildLayoutDelegate {
369
368
}
370
369
// The width of a menu should be at most the view width. This ensures that
371
370
// the menu does not extend past the left and right edges of the screen.
371
+ final double ? menuWidth = route.dropdownStyle.width;
372
372
final double width =
373
- math.min (constraints.maxWidth, itemWidth ?? buttonRect.width);
373
+ math.min (constraints.maxWidth, menuWidth ?? buttonRect.width);
374
374
return BoxConstraints (
375
375
minWidth: width,
376
376
maxWidth: width,
Original file line number Diff line number Diff line change @@ -172,6 +172,8 @@ class DropdownStyleData {
172
172
final double ? maxHeight;
173
173
174
174
/// The width of the dropdown menu
175
+ ///
176
+ /// If it is not provided, the width of the menu is the width of the dropdown button.
175
177
final double ? width;
176
178
177
179
/// The inner padding of the dropdown menu
You can’t perform that action at this time.
0 commit comments