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
237fc2fb
Unverified
Commit
237fc2fb
authored
Jan 29, 2019
by
Hans Muller
Committed by
GitHub
Jan 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PopupMenuDivider.represents() paramter must be void, not Null (#27195)
parent
c082f8d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
2 deletions
+56
-2
popup_menu.dart
packages/flutter/lib/src/material/popup_menu.dart
+1
-2
popup_menu_test.dart
packages/flutter/test/material/popup_menu_test.dart
+55
-0
No files found.
packages/flutter/lib/src/material/popup_menu.dart
View file @
237fc2fb
...
...
@@ -110,8 +110,7 @@ class PopupMenuDivider extends PopupMenuEntry<Null> {
final
double
height
;
@override
// ignore: prefer_void_to_null, https://github.com/dart-lang/sdk/issues/34416
bool
represents
(
Null
value
)
=>
false
;
bool
represents
(
void
value
)
=>
false
;
@override
_PopupMenuDividerState
createState
()
=>
_PopupMenuDividerState
();
...
...
packages/flutter/test/material/popup_menu_test.dart
View file @
237fc2fb
...
...
@@ -551,6 +551,61 @@ void main() {
semantics
.
dispose
();
});
testWidgets
(
'PopupMenuButton PopupMenuDivider'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/27072
String
selectedValue
;
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Scaffold
(
body:
Container
(
child:
Center
(
child:
PopupMenuButton
<
String
>(
onSelected:
(
String
result
)
{
selectedValue
=
result
;
},
child:
const
Text
(
'Menu Button'
),
initialValue:
'1'
,
itemBuilder:
(
BuildContext
context
)
=>
<
PopupMenuEntry
<
String
>>[
const
PopupMenuItem
<
String
>(
child:
Text
(
'1'
),
value:
'1'
,
),
const
PopupMenuDivider
(),
const
PopupMenuItem
<
String
>(
child:
Text
(
'2'
),
value:
'2'
,
),
],
),
),
),
),
),
);
await
tester
.
tap
(
find
.
text
(
'Menu Button'
));
await
tester
.
pumpAndSettle
();
expect
(
find
.
text
(
'1'
),
findsOneWidget
);
expect
(
find
.
byType
(
PopupMenuDivider
),
findsOneWidget
);
expect
(
find
.
text
(
'2'
),
findsOneWidget
);
await
tester
.
tap
(
find
.
text
(
'1'
));
await
tester
.
pumpAndSettle
();
expect
(
selectedValue
,
'1'
);
await
tester
.
tap
(
find
.
text
(
'Menu Button'
));
await
tester
.
pumpAndSettle
();
expect
(
find
.
text
(
'1'
),
findsOneWidget
);
expect
(
find
.
byType
(
PopupMenuDivider
),
findsOneWidget
);
expect
(
find
.
text
(
'2'
),
findsOneWidget
);
await
tester
.
tap
(
find
.
text
(
'2'
));
await
tester
.
pumpAndSettle
();
expect
(
selectedValue
,
'2'
);
});
}
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