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
de966121
Commit
de966121
authored
Aug 20, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #714 from abarth/stack_squish
Stack squishes positioned elements near the edge
parents
d2ca2f26
f7aa8323
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
11 deletions
+3
-11
card_collection.dart
examples/widgets/card_collection.dart
+2
-0
stack.dart
packages/flutter/lib/rendering/stack.dart
+1
-11
No files found.
examples/widgets/card_collection.dart
View file @
de966121
...
...
@@ -76,6 +76,8 @@ class CardCollectionApp extends App {
// background (text and icons) will just be clipped, not resized.
Widget
background
=
new
Positioned
(
top:
0.0
,
right:
0.0
,
bottom:
0.0
,
left:
0.0
,
child:
new
Container
(
margin:
const
EdgeDims
.
all
(
4.0
),
...
...
packages/flutter/lib/rendering/stack.dart
View file @
de966121
...
...
@@ -146,29 +146,19 @@ class RenderStack extends RenderBox with ContainerRenderObjectMixin<RenderBox, S
assert
(
size
.
width
==
constraints
.
constrainWidth
(
width
));
assert
(
size
.
height
==
constraints
.
constrainHeight
(
height
));
BoxConstraints
innerConstraints
=
new
BoxConstraints
.
loose
(
size
);
child
=
firstChild
;
while
(
child
!=
null
)
{
assert
(
child
.
parentData
is
StackParentData
);
final
StackParentData
childData
=
child
.
parentData
;
if
(
childData
.
isPositioned
)
{
BoxConstraints
childConstraints
=
innerConstraints
;
BoxConstraints
childConstraints
=
const
BoxConstraints
()
;
if
(
childData
.
left
!=
null
&&
childData
.
right
!=
null
)
childConstraints
=
childConstraints
.
applyWidth
(
size
.
width
-
childData
.
right
-
childData
.
left
);
else
if
(
childData
.
left
!=
null
)
childConstraints
=
childConstraints
.
applyMaxWidth
(
size
.
width
-
childData
.
left
);
else
if
(
childData
.
right
!=
null
)
childConstraints
=
childConstraints
.
applyMaxWidth
(
size
.
width
-
childData
.
right
);
if
(
childData
.
top
!=
null
&&
childData
.
bottom
!=
null
)
childConstraints
=
childConstraints
.
applyHeight
(
size
.
height
-
childData
.
bottom
-
childData
.
top
);
else
if
(
childData
.
top
!=
null
)
childConstraints
=
childConstraints
.
applyMaxHeight
(
size
.
height
-
childData
.
top
);
else
if
(
childData
.
bottom
!=
null
)
childConstraints
=
childConstraints
.
applyMaxHeight
(
size
.
width
-
childData
.
bottom
);
child
.
layout
(
childConstraints
,
parentUsesSize:
true
);
...
...
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