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
2c44ed0f
Commit
2c44ed0f
authored
Aug 19, 2015
by
Hixie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement 'stretch' for flexible items.
parent
3784201b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
11 deletions
+28
-11
flex.dart
packages/flutter/lib/rendering/flex.dart
+28
-11
No files found.
packages/flutter/lib/rendering/flex.dart
View file @
2c44ed0f
...
@@ -341,17 +341,34 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
...
@@ -341,17 +341,34 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
if
(
flex
>
0
)
{
if
(
flex
>
0
)
{
double
spaceForChild
=
spacePerFlex
*
flex
;
double
spaceForChild
=
spacePerFlex
*
flex
;
BoxConstraints
innerConstraints
;
BoxConstraints
innerConstraints
;
switch
(
_direction
)
{
if
(
alignItems
==
FlexAlignItems
.
stretch
)
{
case
FlexDirection
.
horizontal
:
switch
(
_direction
)
{
innerConstraints
=
new
BoxConstraints
(
maxHeight:
constraints
.
maxHeight
,
case
FlexDirection
.
horizontal
:
minWidth:
spaceForChild
,
innerConstraints
=
new
BoxConstraints
(
minWidth:
constraints
.
maxWidth
,
maxWidth:
spaceForChild
);
maxWidth:
constraints
.
maxWidth
,
break
;
minHeight:
constraints
.
minHeight
,
case
FlexDirection
.
vertical
:
maxHeight:
constraints
.
maxHeight
);
innerConstraints
=
new
BoxConstraints
(
minHeight:
spaceForChild
,
break
;
maxHeight:
spaceForChild
,
case
FlexDirection
.
vertical
:
maxWidth:
constraints
.
maxWidth
);
innerConstraints
=
new
BoxConstraints
(
minWidth:
constraints
.
minWidth
,
break
;
maxWidth:
constraints
.
maxWidth
,
minHeight:
constraints
.
maxHeight
,
maxHeight:
constraints
.
maxHeight
);
break
;
}
}
else
{
switch
(
_direction
)
{
case
FlexDirection
.
horizontal
:
innerConstraints
=
new
BoxConstraints
(
maxHeight:
constraints
.
maxHeight
,
minWidth:
spaceForChild
,
maxWidth:
spaceForChild
);
break
;
case
FlexDirection
.
vertical
:
innerConstraints
=
new
BoxConstraints
(
minHeight:
spaceForChild
,
maxHeight:
spaceForChild
,
maxWidth:
constraints
.
maxWidth
);
break
;
}
}
}
child
.
layout
(
innerConstraints
,
parentUsesSize:
true
);
child
.
layout
(
innerConstraints
,
parentUsesSize:
true
);
usedSpace
+=
_getMainSize
(
child
);
usedSpace
+=
_getMainSize
(
child
);
...
...
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