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
19f615fc
Commit
19f615fc
authored
Mar 12, 2016
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[rename fixit] MultiChildLayoutDelegate#isChild -> hasChild
Fixes #459
parent
44c4e930
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
scaffold.dart
packages/flutter/lib/src/material/scaffold.dart
+6
-6
custom_layout.dart
packages/flutter/lib/src/rendering/custom_layout.dart
+1
-1
custom_multi_child_layout_test.dart
...s/flutter/test/widget/custom_multi_child_layout_test.dart
+1
-1
No files found.
packages/flutter/lib/src/material/scaffold.dart
View file @
19f615fc
...
...
@@ -51,12 +51,12 @@ class _ScaffoldLayout extends MultiChildLayoutDelegate {
double
contentTop
=
padding
.
top
;
double
contentBottom
=
size
.
height
-
padding
.
bottom
;
if
(
i
sChild
(
_ScaffoldSlot
.
toolBar
))
{
if
(
ha
sChild
(
_ScaffoldSlot
.
toolBar
))
{
contentTop
=
layoutChild
(
_ScaffoldSlot
.
toolBar
,
fullWidthConstraints
).
height
;
positionChild
(
_ScaffoldSlot
.
toolBar
,
Offset
.
zero
);
}
if
(
i
sChild
(
_ScaffoldSlot
.
body
))
{
if
(
ha
sChild
(
_ScaffoldSlot
.
body
))
{
final
double
bodyHeight
=
contentBottom
-
contentTop
;
final
BoxConstraints
bodyConstraints
=
fullWidthConstraints
.
tighten
(
height:
bodyHeight
);
layoutChild
(
_ScaffoldSlot
.
body
,
bodyConstraints
);
...
...
@@ -75,17 +75,17 @@ class _ScaffoldLayout extends MultiChildLayoutDelegate {
Size
bottomSheetSize
=
Size
.
zero
;
Size
snackBarSize
=
Size
.
zero
;
if
(
i
sChild
(
_ScaffoldSlot
.
bottomSheet
))
{
if
(
ha
sChild
(
_ScaffoldSlot
.
bottomSheet
))
{
bottomSheetSize
=
layoutChild
(
_ScaffoldSlot
.
bottomSheet
,
fullWidthConstraints
);
positionChild
(
_ScaffoldSlot
.
bottomSheet
,
new
Offset
((
size
.
width
-
bottomSheetSize
.
width
)
/
2.0
,
contentBottom
-
bottomSheetSize
.
height
));
}
if
(
i
sChild
(
_ScaffoldSlot
.
snackBar
))
{
if
(
ha
sChild
(
_ScaffoldSlot
.
snackBar
))
{
snackBarSize
=
layoutChild
(
_ScaffoldSlot
.
snackBar
,
fullWidthConstraints
);
positionChild
(
_ScaffoldSlot
.
snackBar
,
new
Offset
(
0.0
,
contentBottom
-
snackBarSize
.
height
));
}
if
(
i
sChild
(
_ScaffoldSlot
.
floatingActionButton
))
{
if
(
ha
sChild
(
_ScaffoldSlot
.
floatingActionButton
))
{
final
Size
fabSize
=
layoutChild
(
_ScaffoldSlot
.
floatingActionButton
,
looseConstraints
);
final
double
fabX
=
size
.
width
-
fabSize
.
width
-
_kFloatingActionButtonMargin
;
double
fabY
=
contentBottom
-
fabSize
.
height
-
_kFloatingActionButtonMargin
;
...
...
@@ -96,7 +96,7 @@ class _ScaffoldLayout extends MultiChildLayoutDelegate {
positionChild
(
_ScaffoldSlot
.
floatingActionButton
,
new
Offset
(
fabX
,
fabY
));
}
if
(
i
sChild
(
_ScaffoldSlot
.
drawer
))
{
if
(
ha
sChild
(
_ScaffoldSlot
.
drawer
))
{
layoutChild
(
_ScaffoldSlot
.
drawer
,
new
BoxConstraints
.
tight
(
size
));
positionChild
(
_ScaffoldSlot
.
drawer
,
Offset
.
zero
);
}
...
...
packages/flutter/lib/src/rendering/custom_layout.dart
View file @
19f615fc
...
...
@@ -32,7 +32,7 @@ abstract class MultiChildLayoutDelegate {
/// Call this from the [performLayout] or [getSize] methods to
/// determine which children are available, if the child list might
/// vary.
bool
i
sChild
(
Object
childId
)
=>
_idToChild
[
childId
]
!=
null
;
bool
ha
sChild
(
Object
childId
)
=>
_idToChild
[
childId
]
!=
null
;
/// Ask the child to update its layout within the limits specified by
/// the constraints parameter. The child's size is returned.
...
...
packages/flutter/test/widget/custom_multi_child_layout_test.dart
View file @
19f615fc
...
...
@@ -28,7 +28,7 @@ class TestMultiChildLayoutDelegate extends MultiChildLayoutDelegate {
BoxConstraints
constraints
=
new
BoxConstraints
.
loose
(
size
);
performLayoutSize0
=
layoutChild
(
0
,
constraints
);
performLayoutSize1
=
layoutChild
(
1
,
constraints
);
performLayoutIsChild
=
i
sChild
(
'fred'
);
performLayoutIsChild
=
ha
sChild
(
'fred'
);
},
returnsNormally
);
}
...
...
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