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
a508d358
Unverified
Commit
a508d358
authored
Dec 01, 2020
by
Pierre-Louis
Committed by
GitHub
Dec 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use adaptive more icon for popup_menu (#70773)
parent
8522ec7e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
16 deletions
+5
-16
popup_menu.dart
packages/flutter/lib/src/material/popup_menu.dart
+1
-15
popup_menu_test.dart
packages/flutter/test/material/popup_menu_test.dart
+4
-1
No files found.
packages/flutter/lib/src/material/popup_menu.dart
View file @
a508d358
...
@@ -1102,20 +1102,6 @@ class PopupMenuButtonState<T> extends State<PopupMenuButton<T>> {
...
@@ -1102,20 +1102,6 @@ class PopupMenuButtonState<T> extends State<PopupMenuButton<T>> {
}
}
}
}
Icon
_getIcon
(
TargetPlatform
platform
)
{
assert
(
platform
!=
null
);
switch
(
platform
)
{
case
TargetPlatform
.
android
:
case
TargetPlatform
.
fuchsia
:
case
TargetPlatform
.
linux
:
case
TargetPlatform
.
windows
:
return
const
Icon
(
Icons
.
more_vert
);
case
TargetPlatform
.
iOS
:
case
TargetPlatform
.
macOS
:
return
const
Icon
(
Icons
.
more_horiz
);
}
}
bool
get
_canRequestFocus
{
bool
get
_canRequestFocus
{
final
NavigationMode
mode
=
MediaQuery
.
maybeOf
(
context
)?.
navigationMode
??
NavigationMode
.
traditional
;
final
NavigationMode
mode
=
MediaQuery
.
maybeOf
(
context
)?.
navigationMode
??
NavigationMode
.
traditional
;
switch
(
mode
)
{
switch
(
mode
)
{
...
@@ -1146,7 +1132,7 @@ class PopupMenuButtonState<T> extends State<PopupMenuButton<T>> {
...
@@ -1146,7 +1132,7 @@ class PopupMenuButtonState<T> extends State<PopupMenuButton<T>> {
);
);
return
IconButton
(
return
IconButton
(
icon:
widget
.
icon
??
_getIcon
(
Theme
.
of
(
context
).
platform
),
icon:
widget
.
icon
??
Icon
(
Icons
.
adaptive
.
more
),
padding:
widget
.
padding
,
padding:
widget
.
padding
,
tooltip:
widget
.
tooltip
??
MaterialLocalizations
.
of
(
context
).
showMenuTooltip
,
tooltip:
widget
.
tooltip
??
MaterialLocalizations
.
of
(
context
).
showMenuTooltip
,
onPressed:
widget
.
enabled
?
showButtonMenu
:
null
,
onPressed:
widget
.
enabled
?
showButtonMenu
:
null
,
...
...
packages/flutter/test/material/popup_menu_test.dart
View file @
a508d358
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
import
'dart:ui'
show
window
,
SemanticsFlag
;
import
'dart:ui'
show
window
,
SemanticsFlag
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/rendering.dart'
;
...
@@ -368,8 +369,8 @@ void main() {
...
@@ -368,8 +369,8 @@ void main() {
testWidgets
(
'PopupMenuButton is horizontal on iOS'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'PopupMenuButton is horizontal on iOS'
,
(
WidgetTester
tester
)
async
{
Widget
build
(
TargetPlatform
platform
)
{
Widget
build
(
TargetPlatform
platform
)
{
debugDefaultTargetPlatformOverride
=
platform
;
return
MaterialApp
(
return
MaterialApp
(
theme:
ThemeData
(
platform:
platform
),
home:
Scaffold
(
home:
Scaffold
(
appBar:
AppBar
(
appBar:
AppBar
(
actions:
<
Widget
>[
actions:
<
Widget
>[
...
@@ -405,6 +406,8 @@ void main() {
...
@@ -405,6 +406,8 @@ void main() {
expect
(
find
.
byIcon
(
Icons
.
more_vert
),
findsNothing
);
expect
(
find
.
byIcon
(
Icons
.
more_vert
),
findsNothing
);
expect
(
find
.
byIcon
(
Icons
.
more_horiz
),
findsOneWidget
);
expect
(
find
.
byIcon
(
Icons
.
more_horiz
),
findsOneWidget
);
debugDefaultTargetPlatformOverride
=
null
;
});
});
group
(
'PopupMenuButton with Icon'
,
()
{
group
(
'PopupMenuButton with Icon'
,
()
{
...
...
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