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
500a3324
Unverified
Commit
500a3324
authored
Jan 05, 2022
by
Dheeraj Verma
Committed by
GitHub
Jan 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DropdownButtonFormField] Add borderRadius property (#95944)
parent
99bf2e9b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
0 deletions
+51
-0
dropdown.dart
packages/flutter/lib/src/material/dropdown.dart
+4
-0
dropdown_test.dart
packages/flutter/test/material/dropdown_test.dart
+47
-0
No files found.
packages/flutter/lib/src/material/dropdown.dart
View file @
500a3324
...
...
@@ -1540,6 +1540,9 @@ class DropdownButtonFormField<T> extends FormField<T> {
double
?
menuMaxHeight
,
bool
?
enableFeedback
,
AlignmentGeometry
alignment
=
AlignmentDirectional
.
centerStart
,
BorderRadius
?
borderRadius
,
// When adding new arguments, consider adding similar arguments to
// DropdownButton.
})
:
assert
(
items
==
null
||
items
.
isEmpty
||
value
==
null
||
items
.
where
((
DropdownMenuItem
<
T
>
item
)
{
return
item
.
value
==
value
;
...
...
@@ -1615,6 +1618,7 @@ class DropdownButtonFormField<T> extends FormField<T> {
menuMaxHeight:
menuMaxHeight
,
enableFeedback:
enableFeedback
,
alignment:
alignment
,
borderRadius:
borderRadius
,
),
),
);
...
...
packages/flutter/test/material/dropdown_test.dart
View file @
500a3324
...
...
@@ -3678,4 +3678,51 @@ void main() {
expect
(
tester
.
takeException
(),
null
);
});
testWidgets
(
'BorderRadius property works properly for DropdownButtonFormField'
,
(
WidgetTester
tester
)
async
{
const
double
radius
=
20.0
;
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Scaffold
(
body:
Center
(
child:
DropdownButtonFormField
<
String
>(
borderRadius:
BorderRadius
.
circular
(
radius
),
value:
'One'
,
items:
<
String
>[
'One'
,
'Two'
,
'Three'
,
'Four'
]
.
map
<
DropdownMenuItem
<
String
>>((
String
value
)
{
return
DropdownMenuItem
<
String
>(
value:
value
,
child:
Text
(
value
),
);
}).
toList
(),
onChanged:
(
_
)
{
},
),
),
),
),
);
await
tester
.
tap
(
find
.
text
(
'One'
));
await
tester
.
pumpAndSettle
();
expect
(
find
.
ancestor
(
of:
find
.
text
(
'One'
).
last
,
matching:
find
.
byType
(
CustomPaint
),
).
at
(
2
),
paints
..
save
()
..
rrect
()
..
rrect
()
..
rrect
()
..
rrect
(
rrect:
const
RRect
.
fromLTRBXY
(
0.0
,
0.0
,
800.0
,
208.0
,
radius
,
radius
)),
);
final
InkWell
firstItem
=
tester
.
widget
(
find
.
widgetWithText
(
InkWell
,
'One'
));
final
InkWell
lastItem
=
tester
.
widget
(
find
.
widgetWithText
(
InkWell
,
'Four'
));
expect
(
firstItem
.
borderRadius
,
const
BorderRadius
.
vertical
(
top:
Radius
.
circular
(
radius
)));
expect
(
lastItem
.
borderRadius
,
const
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
radius
)));
});
}
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