Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
a54b1025
Unverified
Commit
a54b1025
authored
3 years ago
by
Alex Fourman
Committed by
GitHub
3 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes DropdownButton ignoring itemHeight in popup menu (#88574) (#88576)
parent
baecbdfe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
0 deletions
+42
-0
dropdown.dart
packages/flutter/lib/src/material/dropdown.dart
+1
-0
dropdown_test.dart
packages/flutter/test/material/dropdown_test.dart
+41
-0
No files found.
packages/flutter/lib/src/material/dropdown.dart
View file @
a54b1025
...
...
@@ -175,6 +175,7 @@ class _DropdownMenuItemButtonState<T> extends State<_DropdownMenuItemButton<T>>
}
Widget
child
=
Container
(
padding:
widget
.
padding
,
height:
widget
.
route
.
itemHeight
,
child:
widget
.
route
.
items
[
widget
.
itemIndex
],
);
final
BorderRadius
itemBorderRadius
;
...
...
This diff is collapsed.
Click to expand it.
packages/flutter/test/material/dropdown_test.dart
View file @
a54b1025
...
...
@@ -3559,4 +3559,45 @@ void main() {
expect
(
menuItem
.
borderRadius
,
borderRadius
);
});
// Regression test for https://github.com/flutter/flutter/issues/88574
testWidgets
(
"specifying itemHeight affects popup menu items' height"
,
(
WidgetTester
tester
)
async
{
const
String
value
=
'One'
;
const
double
itemHeight
=
80
;
final
List
<
DropdownMenuItem
<
String
>>
menuItems
=
<
String
>[
value
,
'Two'
,
'Free'
,
'Four'
].
map
<
DropdownMenuItem
<
String
>>((
String
value
)
{
return
DropdownMenuItem
<
String
>(
value:
value
,
child:
Text
(
value
),
);
}).
toList
();
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Scaffold
(
body:
Center
(
child:
DropdownButton
<
String
>(
value:
value
,
itemHeight:
itemHeight
,
onChanged:
(
_
)
{},
items:
menuItems
,
),
),
),
),
);
await
tester
.
tap
(
find
.
text
(
value
));
await
tester
.
pumpAndSettle
();
for
(
final
DropdownMenuItem
<
String
>
item
in
menuItems
)
{
final
Iterable
<
Element
>
elements
=
tester
.
elementList
(
find
.
byWidget
(
item
));
for
(
final
Element
element
in
elements
){
expect
(
element
.
size
!.
height
,
itemHeight
);
}
}
});
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment