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
e903485d
Commit
e903485d
authored
Oct 28, 2019
by
creativecreatorormaybenot
Committed by
Shi-Hao Hong
Oct 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change PopupMenuButton.icon type to Widget (#43526)
parent
c461ff9d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
3 deletions
+28
-3
popup_menu.dart
packages/flutter/lib/src/material/popup_menu.dart
+5
-3
popup_menu_test.dart
packages/flutter/test/material/popup_menu_test.dart
+23
-0
No files found.
packages/flutter/lib/src/material/popup_menu.dart
View file @
e903485d
...
@@ -978,11 +978,13 @@ class PopupMenuButton<T> extends StatefulWidget {
...
@@ -978,11 +978,13 @@ class PopupMenuButton<T> extends StatefulWidget {
/// to set the padding to zero.
/// to set the padding to zero.
final
EdgeInsetsGeometry
padding
;
final
EdgeInsetsGeometry
padding
;
/// If provided, the widget used for this button.
/// If provided, [child] is the widget used for this button
/// and the button will utilize an [InkWell] for taps.
final
Widget
child
;
final
Widget
child
;
/// If provided, the icon used for this button.
/// If provided, the [icon] is used for this button
final
Icon
icon
;
/// and the button will behave like an [IconButton].
final
Widget
icon
;
/// The offset applied to the Popup Menu Button.
/// The offset applied to the Popup Menu Button.
///
///
...
...
packages/flutter/test/material/popup_menu_test.dart
View file @
e903485d
...
@@ -974,6 +974,29 @@ void main() {
...
@@ -974,6 +974,29 @@ void main() {
expect
(
find
.
byType
(
Tooltip
),
findsNWidgets
(
3
));
expect
(
find
.
byType
(
Tooltip
),
findsNWidgets
(
3
));
expect
(
find
.
byTooltip
(
'Test tooltip'
,),
findsNWidgets
(
3
));
expect
(
find
.
byTooltip
(
'Test tooltip'
,),
findsNWidgets
(
3
));
});
});
testWidgets
(
'Allow Widget for PopupMenuButton.icon'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Material
(
child:
PopupMenuButton
<
int
>(
itemBuilder:
(
BuildContext
context
)
{
return
<
PopupMenuEntry
<
int
>>[
const
PopupMenuItem
<
int
>(
value:
1
,
child:
Text
(
'Tap me please!'
),
),
];
},
tooltip:
'Test tooltip'
,
icon:
const
Text
(
'PopupMenuButton icon'
),
),
),
),
);
expect
(
find
.
text
(
'PopupMenuButton icon'
),
findsOneWidget
);
});
}
}
class
TestApp
extends
StatefulWidget
{
class
TestApp
extends
StatefulWidget
{
...
...
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