Skip to content

Commit 7825db8

Browse files
authored
Merge pull request #352 from AhmedLSayed9/minor_renaming
Minor renaming
2 parents 59fd06a + 6cbc2d4 commit 7825db8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/dropdown_button2/lib/src/dropdown_route.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,6 @@ class _DropdownMenuRouteLayout<T> extends SingleChildLayoutDelegate {
360360

361361
@override
362362
BoxConstraints getConstraintsForChild(BoxConstraints constraints) {
363-
final double? itemWidth = route.dropdownStyle.width;
364363
double maxHeight =
365364
route.getMenuAvailableHeight(availableHeight, mediaQueryPadding);
366365
final double? preferredMaxHeight = route.dropdownStyle.maxHeight;
@@ -369,8 +368,9 @@ class _DropdownMenuRouteLayout<T> extends SingleChildLayoutDelegate {
369368
}
370369
// The width of a menu should be at most the view width. This ensures that
371370
// the menu does not extend past the left and right edges of the screen.
371+
final double? menuWidth = route.dropdownStyle.width;
372372
final double width =
373-
math.min(constraints.maxWidth, itemWidth ?? buttonRect.width);
373+
math.min(constraints.maxWidth, menuWidth ?? buttonRect.width);
374374
return BoxConstraints(
375375
minWidth: width,
376376
maxWidth: width,

packages/dropdown_button2/lib/src/dropdown_style_data.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ class DropdownStyleData {
172172
final double? maxHeight;
173173

174174
/// 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.
175177
final double? width;
176178

177179
/// The inner padding of the dropdown menu

0 commit comments

Comments
 (0)