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
c243d834
Unverified
Commit
c243d834
authored
Jan 08, 2021
by
Michael Goderbauer
Committed by
GitHub
Jan 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix _LateInitializationError for RenderObjectElement.renderObject (#70974)
parent
5bc725be
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+4
-4
framework_test.dart
packages/flutter/test/widgets/framework_test.dart
+10
-0
No files found.
packages/flutter/lib/src/widgets/framework.dart
View file @
c243d834
...
...
@@ -5463,8 +5463,8 @@ abstract class RenderObjectElement extends Element {
/// The underlying [RenderObject] for this element.
@override
RenderObject
get
renderObject
=>
_renderObject
;
late
RenderObject
_renderObject
;
RenderObject
get
renderObject
=>
_renderObject
!
;
RenderObject
?
_renderObject
;
bool
_debugDoingBuild
=
false
;
@override
...
...
@@ -5566,7 +5566,7 @@ abstract class RenderObjectElement extends Element {
void
_debugUpdateRenderObjectOwner
()
{
assert
(()
{
_
renderObject
.
debugCreator
=
DebugCreator
(
this
);
renderObject
.
debugCreator
=
DebugCreator
(
this
);
return
true
;
}());
}
...
...
@@ -6058,7 +6058,7 @@ abstract class RenderObjectElement extends Element {
@override
void
debugFillProperties
(
DiagnosticPropertiesBuilder
properties
)
{
super
.
debugFillProperties
(
properties
);
properties
.
add
(
DiagnosticsProperty
<
RenderObject
>(
'renderObject'
,
renderObject
,
defaultValue:
null
));
properties
.
add
(
DiagnosticsProperty
<
RenderObject
>(
'renderObject'
,
_
renderObject
,
defaultValue:
null
));
}
}
...
...
packages/flutter/test/widgets/framework_test.dart
View file @
c243d834
...
...
@@ -1494,6 +1494,12 @@ void main() {
expect
(
GestureBinding
.
instance
!.
pointerRouter
.
debugGlobalRouteCount
,
pointerRouterCount
);
expect
(
RawKeyboard
.
instance
.
keyEventHandler
,
same
(
rawKeyEventHandler
));
});
testWidgets
(
'Can access debugFillProperties without _LateInitializationError'
,
(
WidgetTester
tester
)
async
{
final
DiagnosticPropertiesBuilder
builder
=
DiagnosticPropertiesBuilder
();
TestRenderObjectElement
().
debugFillProperties
(
builder
);
expect
(
builder
.
properties
.
any
((
DiagnosticsNode
property
)
=>
property
.
name
==
'renderObject'
&&
property
.
value
==
null
),
isTrue
);
});
}
class
_FakeFocusManager
implements
FocusManager
{
...
...
@@ -1837,3 +1843,7 @@ class FakeLeafRenderObject extends RenderBox {
size
=
constraints
.
biggest
;
}
}
class
TestRenderObjectElement
extends
RenderObjectElement
{
TestRenderObjectElement
()
:
super
(
Table
());
}
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