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
ffad464c
Commit
ffad464c
authored
Dec 10, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #877 from abarth/better_asserts
Improve asserts when performLayout missing
parents
4fa9e571
2edb6807
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
box.dart
packages/flutter/lib/src/rendering/box.dart
+10
-4
No files found.
packages/flutter/lib/src/rendering/box.dart
View file @
ffad464c
...
...
@@ -564,11 +564,16 @@ abstract class RenderBox extends RenderObject {
assert
(!
size
.
isInfinite
);
}
void
performLayout
()
{
// descendants have to either override performLayout() to set both
// width and height and lay out children, or, set sizedByParent to
// true so that performResize()'s logic above does its thing.
assert
(()
{
if
(!
sizedByParent
)
{
debugPrint
(
'
$runtimeType
needs to either override performLayout() to
\n
'
'set size and lay out children, or, set sizedByParent to true
\n
'
'so that performResize() sizes the render object.'
);
assert
(
sizedByParent
);
}
return
true
;
});
}
/// Determines the set of render objects located at the given position
///
...
...
@@ -581,6 +586,7 @@ abstract class RenderBox extends RenderObject {
/// whether the given position is within its bounds.
bool
hitTest
(
HitTestResult
result
,
{
Point
position
})
{
assert
(!
needsLayout
);
assert
(
_size
!=
null
&&
'Missing size. Did you set a size during layout?'
!=
null
);
if
(
position
.
x
>=
0.0
&&
position
.
x
<
_size
.
width
&&
position
.
y
>=
0.0
&&
position
.
y
<
_size
.
height
)
{
if
(
hitTestChildren
(
result
,
position:
position
)
||
hitTestSelf
(
position
))
{
...
...
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