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
620fb875
Commit
620fb875
authored
Apr 28, 2016
by
Hans Muller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable lining up the last tool bar action trailing list item elements (#3597)
parent
4aa37568
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
list_demo.dart
examples/material_gallery/lib/demo/list_demo.dart
+1
-1
menu_demo.dart
examples/material_gallery/lib/demo/menu_demo.dart
+5
-1
popup_menu.dart
packages/flutter/lib/src/material/popup_menu.dart
+7
-0
No files found.
examples/material_gallery/lib/demo/list_demo.dart
View file @
620fb875
...
...
@@ -195,7 +195,7 @@ class ListDemoState extends State<ListDemo> {
child:
new
Scrollbar
(
child:
new
MaterialList
(
type:
_itemType
,
padding:
new
EdgeInsets
.
all
(
_dense
?
4.0
:
8.0
),
padding:
new
EdgeInsets
.
symmetric
(
vertical:
_dense
?
4.0
:
8.0
),
children:
listItems
)
)
...
...
examples/material_gallery/lib/demo/menu_demo.dart
View file @
620fb875
...
...
@@ -84,7 +84,7 @@ class MenuDemoState extends State<MenuDemo> {
]
),
body:
new
Block
(
padding:
const
EdgeInsets
.
all
(
8.0
),
padding:
const
EdgeInsets
.
symmetric
(
vertical:
8.0
),
children:
<
Widget
>[
// Pressing the PopupMenuButton on the right of this item shows
// a simple menu with one disabled item. Typically the contents
...
...
@@ -92,6 +92,7 @@ class MenuDemoState extends State<MenuDemo> {
new
ListItem
(
title:
new
Text
(
'An item with a context menu button'
),
trailing:
new
PopupMenuButton
<
String
>(
padding:
EdgeInsets
.
zero
,
onSelected:
showMenuSelection
,
itemBuilder:
(
BuildContext
context
)
=>
<
PopupMenuItem
<
String
>>[
new
PopupMenuItem
<
String
>(
...
...
@@ -115,6 +116,7 @@ class MenuDemoState extends State<MenuDemo> {
new
ListItem
(
title:
new
Text
(
'An item with a sectioned menu'
),
trailing:
new
PopupMenuButton
<
String
>(
padding:
EdgeInsets
.
zero
,
onSelected:
showMenuSelection
,
itemBuilder:
(
BuildContext
context
)
=>
<
PopupMenuEntry
<
String
>>[
new
PopupMenuItem
<
String
>(
...
...
@@ -153,6 +155,7 @@ class MenuDemoState extends State<MenuDemo> {
// a menu whose current value is highlighted and aligned over the
// list item's center line.
new
PopupMenuButton
<
String
>(
padding:
EdgeInsets
.
zero
,
initialValue:
_simpleValue
,
onSelected:
showMenuSelection
,
child:
new
ListItem
(
...
...
@@ -179,6 +182,7 @@ class MenuDemoState extends State<MenuDemo> {
new
ListItem
(
title:
new
Text
(
'An item with a checklist menu'
),
trailing:
new
PopupMenuButton
<
String
>(
padding:
EdgeInsets
.
zero
,
onSelected:
showCheckedMenuSelections
,
itemBuilder:
(
BuildContext
context
)
=>
<
PopupMenuItem
<
String
>>[
new
CheckedPopupMenuItem
<
String
>(
...
...
packages/flutter/lib/src/material/popup_menu.dart
View file @
620fb875
...
...
@@ -398,6 +398,7 @@ class PopupMenuButton<T> extends StatefulWidget {
this
.
onSelected
,
this
.
tooltip
:
'Show menu'
,
this
.
elevation
:
8
,
this
.
padding
:
const
EdgeInsets
.
all
(
8.0
),
this
.
child
})
:
super
(
key:
key
)
{
assert
(
itemBuilder
!=
null
);
...
...
@@ -421,6 +422,11 @@ class PopupMenuButton<T> extends StatefulWidget {
/// The following elevations have defined shadows: 1, 2, 3, 4, 6, 8, 9, 12, 16, 24
final
int
elevation
;
/// Matches IconButton's 8 dps padding by default. In some cases, notably where
/// this button appears as the trailing element of a list item, it's useful to be able
/// to set the padding to zero.
final
EdgeInsets
padding
;
/// The widget below this widget in the tree.
final
Widget
child
;
...
...
@@ -453,6 +459,7 @@ class _PopupMenuButtonState<T> extends State<PopupMenuButton<T>> {
if
(
config
.
child
==
null
)
{
return
new
IconButton
(
icon:
Icons
.
more_vert
,
padding:
config
.
padding
,
tooltip:
config
.
tooltip
,
onPressed:
()
{
showButtonMenu
(
context
);
}
);
...
...
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