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
3cfc9c4d
Commit
3cfc9c4d
authored
Oct 08, 2015
by
Hans Muller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow Stacks with no children or only poisitioned children
parent
6111301a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
stack.dart
packages/flutter/lib/src/rendering/stack.dart
+5
-4
stack_test.dart
packages/unit/test/widget/stack_test.dart
+12
-0
No files found.
packages/flutter/lib/src/rendering/stack.dart
View file @
3cfc9c4d
...
...
@@ -172,14 +172,15 @@ abstract class RenderStackBase extends RenderBox
child
=
parentData
.
nextSibling
;
}
if
(
hasNonPositionedChildren
)
if
(
hasNonPositionedChildren
)
{
size
=
new
Size
(
width
,
height
);
else
assert
(
size
.
width
==
constraints
.
constrainWidth
(
width
));
assert
(
size
.
height
==
constraints
.
constrainHeight
(
height
));
}
else
{
size
=
constraints
.
biggest
;
}
assert
(!
size
.
isInfinite
);
assert
(
size
.
width
==
constraints
.
constrainWidth
(
width
));
assert
(
size
.
height
==
constraints
.
constrainHeight
(
height
));
child
=
firstChild
;
while
(
child
!=
null
)
{
...
...
packages/unit/test/widget/stack_test.dart
View file @
3cfc9c4d
...
...
@@ -10,6 +10,12 @@ void main() {
});
});
test
(
'Can construct an empty Centered Stack'
,
()
{
testWidgets
((
WidgetTester
tester
)
{
tester
.
pumpWidget
(
new
Center
(
child:
new
Stack
([])));
});
});
test
(
'Can change position data'
,
()
{
testWidgets
((
WidgetTester
tester
)
{
Key
key
=
new
Key
(
'container'
);
...
...
@@ -108,6 +114,12 @@ void main() {
});
});
test
(
'Can construct an empty Centered IndexedStack'
,
()
{
testWidgets
((
WidgetTester
tester
)
{
tester
.
pumpWidget
(
new
Center
(
child:
new
IndexedStack
([])));
});
});
test
(
'Can construct an IndexedStack'
,
()
{
testWidgets
((
WidgetTester
tester
)
{
int
itemCount
=
3
;
...
...
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