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
844cf1fa
Commit
844cf1fa
authored
Sep 11, 2015
by
Andrew Wilson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1131 from apwilson/shrinkwrap
Shrink wrap when constraints are infinite.
parents
0c4a86a9
380cfb26
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
shifted_box.dart
packages/flutter/lib/src/rendering/shifted_box.dart
+3
-2
center_test.dart
packages/unit/test/widget/center_test.dart
+15
-0
No files found.
packages/flutter/lib/src/rendering/shifted_box.dart
View file @
844cf1fa
...
...
@@ -194,8 +194,9 @@ class RenderPositionedBox extends RenderShiftedBox {
markNeedsLayout
();
}
bool
get
_shinkWrapWidth
=>
_shrinkWrap
==
ShrinkWrap
.
width
||
_shrinkWrap
==
ShrinkWrap
.
both
;
bool
get
_shinkWrapHeight
=>
_shrinkWrap
==
ShrinkWrap
.
height
||
_shrinkWrap
==
ShrinkWrap
.
both
;
// These are only valid during performLayout() and paint(), since they rely on constraints which is only set after layout() is called.
bool
get
_shinkWrapWidth
=>
_shrinkWrap
==
ShrinkWrap
.
width
||
_shrinkWrap
==
ShrinkWrap
.
both
||
constraints
.
maxWidth
==
double
.
INFINITY
;
bool
get
_shinkWrapHeight
=>
_shrinkWrap
==
ShrinkWrap
.
height
||
_shrinkWrap
==
ShrinkWrap
.
both
||
constraints
.
maxHeight
==
double
.
INFINITY
;
void
performLayout
()
{
if
(
child
!=
null
)
{
...
...
packages/unit/test/widget/center_test.dart
0 → 100644
View file @
844cf1fa
import
'package:sky/widgets.dart'
;
import
'package:test/test.dart'
;
import
'widget_tester.dart'
;
void
main
(
)
{
test
(
'Can be placed in an infinte box'
,
()
{
WidgetTester
tester
=
new
WidgetTester
();
tester
.
pumpFrame
(()
{
return
new
Block
([
new
Center
()]);
});
});
}
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