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
4d8f38e5
Commit
4d8f38e5
authored
May 09, 2016
by
Hans Muller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct ListItem leading/trailing widget layout (#3820)
parent
a6a3f2c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
list_item.dart
packages/flutter/lib/src/material/list_item.dart
+6
-12
No files found.
packages/flutter/lib/src/material/list_item.dart
View file @
4d8f38e5
...
...
@@ -43,9 +43,7 @@ class ListItem extends StatelessWidget {
this
.
enabled
:
true
,
this
.
onTap
,
this
.
onLongPress
})
:
super
(
key:
key
)
{
assert
(
isThreeLine
?
subtitle
!=
null
:
true
);
}
})
:
super
(
key:
key
);
/// A widget to display before the title.
///
...
...
@@ -149,19 +147,15 @@ class ListItem extends StatelessWidget {
else
itemHeight
=
dense
?
76.0
:
88.0
;
double
iconMarginTop
=
0.0
;
if
(
isThreeLine
)
iconMarginTop
=
dense
?
8.0
:
16.0
;
// Overall, the list item is a Row() with these children.
final
List
<
Widget
>
children
=
<
Widget
>[];
if
(
leading
!=
null
)
{
children
.
add
(
new
Container
(
margin:
new
EdgeInsets
.
only
(
right:
16.0
,
top:
iconMarginTop
),
margin:
const
EdgeInsets
.
only
(
right:
16.0
),
width:
40.0
,
child:
new
Align
(
alignment:
new
FractionalOffset
(
0.0
,
isThreeLine
?
0.0
:
0.5
)
,
alignment:
FractionalOffset
.
centerLeft
,
child:
leading
)
));
...
...
@@ -173,7 +167,7 @@ class ListItem extends StatelessWidget {
child:
title
??
new
Container
()
);
Widget
center
=
primaryLine
;
if
(
isTwoLine
||
isThreeLine
)
{
if
(
subtitle
!=
null
&&
(
isTwoLine
||
isThreeLine
)
)
{
center
=
new
Column
(
mainAxisAlignment:
MainAxisAlignment
.
collapse
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
...
...
@@ -193,9 +187,9 @@ class ListItem extends StatelessWidget {
if
(
trailing
!=
null
)
{
children
.
add
(
new
Container
(
margin:
new
EdgeInsets
.
only
(
left:
16.0
,
top:
iconMarginTop
),
margin:
const
EdgeInsets
.
only
(
left:
16.0
),
child:
new
Align
(
alignment:
new
FractionalOffset
(
1.0
,
isThreeLine
?
0.0
:
0.5
)
,
alignment:
FractionalOffset
.
centerRight
,
child:
trailing
)
));
...
...
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