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
695a1358
Commit
695a1358
authored
Jul 17, 2015
by
Collin Jackson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update example
parent
07f9c95e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
16 deletions
+11
-16
align_items.dart
packages/flutter/example/rendering/align_items.dart
+10
-15
box.dart
packages/flutter/lib/rendering/box.dart
+1
-1
No files found.
packages/flutter/example/rendering/align_items.dart
View file @
695a1358
...
...
@@ -16,39 +16,34 @@ import 'solid_color_box.dart';
void
main
(
)
{
var
table
=
new
RenderFlex
(
direction:
FlexDirection
.
vertical
);
void
addRow
(
FlexAlignItems
align
)
{
for
(
FlexAlignItems
alignItems
in
FlexAlignItems
.
values
)
{
TextStyle
style
=
const
TextStyle
(
color:
const
Color
(
0xFF000000
));
RenderParagraph
paragraph
=
new
RenderParagraph
(
new
InlineStyle
(
style
,
[
new
InlineText
(
"
${align}
"
)]));
RenderParagraph
paragraph
=
new
RenderParagraph
(
new
InlineStyle
(
style
,
[
new
InlineText
(
"
${align
Items
}
"
)]));
table
.
add
(
new
RenderPadding
(
child:
paragraph
,
padding:
new
EdgeDims
.
only
(
top:
20.0
)));
var
row
=
new
RenderFlex
(
direction:
FlexDirection
.
horizontal
);
var
row
=
new
RenderFlex
(
alignItems:
alignItems
);
style
=
new
TextStyle
(
fontSize:
15.0
,
color:
const
Color
(
0xFF000000
));
row
.
add
(
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0x
F
FFFCCCC
)),
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0x
7
FFFCCCC
)),
child:
new
RenderParagraph
(
new
InlineStyle
(
style
,
[
new
InlineText
(
'foo foo foo'
)]))
));
style
=
new
TextStyle
(
fontSize:
10.0
,
color:
const
Color
(
0xFF000000
));
row
.
add
(
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0x
F
FCCFFCC
)),
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0x
7
FCCFFCC
)),
child:
new
RenderParagraph
(
new
InlineStyle
(
style
,
[
new
InlineText
(
'foo foo foo'
)]))
));
var
subrow
=
new
RenderFlex
(
alignItems:
alignItems
);
style
=
new
TextStyle
(
fontSize:
25.0
,
color:
const
Color
(
0xFF000000
));
row
.
add
(
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0x
F
FCCCCFF
)),
sub
row
.
add
(
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0x
7
FCCCCFF
)),
child:
new
RenderParagraph
(
new
InlineStyle
(
style
,
[
new
InlineText
(
'foo foo foo foo'
)]))
));
row
.
add
(
new
RenderSolidColorBox
(
const
Color
(
0xF
FCCFFFF
),
desiredSize:
new
Size
(
30.0
,
40.0
)));
row
.
a
lignItems
=
align
;
subrow
.
add
(
new
RenderSolidColorBox
(
const
Color
(
0x7
FCCFFFF
),
desiredSize:
new
Size
(
30.0
,
40.0
)));
row
.
a
dd
(
subrow
)
;
table
.
add
(
row
);
row
.
parentData
.
flex
=
1
;
}
addRow
(
FlexAlignItems
.
start
);
addRow
(
FlexAlignItems
.
end
);
addRow
(
FlexAlignItems
.
center
);
addRow
(
FlexAlignItems
.
stretch
);
addRow
(
FlexAlignItems
.
baseline
);
RenderDecoratedBox
root
=
new
RenderDecoratedBox
(
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0xFFFFFFFF
)),
child:
new
RenderPadding
(
child:
table
,
padding:
new
EdgeDims
.
symmetric
(
vertical:
50.0
))
...
...
packages/flutter/lib/rendering/box.dart
View file @
695a1358
...
...
@@ -1662,7 +1662,7 @@ abstract class RenderBoxContainerDefaultsMixin<ChildType extends RenderBox, Pare
assert
(
child
.
parentData
is
ParentDataType
);
double
candidate
=
child
.
getDistanceToActualBaseline
(
baseline
);
if
(
candidate
!=
null
)
{
candidate
+=
child
.
parentData
.
position
.
x
;
candidate
+=
child
.
parentData
.
position
.
y
;
if
(
result
!=
null
)
result
=
math
.
min
(
result
,
candidate
);
else
...
...
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