-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consolefound in release: 3.7Found to occur in 3.7Found to occur in 3.7found in release: 3.9Found to occur in 3.9Found to occur in 3.9frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Description
Here's the implementation for insertRenderObjectChild in RenderObjectElement
@protected
void insertRenderObjectChild(covariant RenderObject child, covariant Object? slot) {
assert(() {
throw FlutterError.fromParts(<DiagnosticsNode>[
ErrorSummary('RenderObjectElement.insertChildRenderObject() is deprecated.'),
toDiagnosticsNode(
name: 'insertChildRenderObject() was called on this Element',
style: DiagnosticsTreeStyle.shallow,
),
ErrorDescription(
'insertChildRenderObject() has been deprecated in favor of '
'insertRenderObjectChild(). See https://github.com/flutter/flutter/issues/63269 '
'for details.',
),
ErrorHint(
'Rather than overriding insertChildRenderObject() in your '
'RenderObjectElement subclass, override insertRenderObjectChild() instead, '
"and DON'T call super.insertRenderObjectChild(). If you're implementing a "
'new RenderObjectElement, you should override/implement '
'insertRenderObjectChild(), moveRenderObjectChild(), and '
'removeRenderObjectChild().',
),
]);
}());
}This method throws an error that says "insertChildRenderObject() has been deprecated in favor of insertRenderObjectChild()". Except, this method isn't called insertChildRenderObject(), it's called insertRenderObjectChild, which means this is the method that the error message is telling us to use.
This method is called from:
@override
void attachRenderObject(Object? newSlot) {
assert(_ancestorRenderObjectElement == null);
_slot = newSlot;
_ancestorRenderObjectElement = _findAncestorRenderObjectElement();
_ancestorRenderObjectElement?.insertRenderObjectChild(renderObject, newSlot);
final ParentDataElement<ParentData>? parentDataElement = _findAncestorParentDataElement();
if (parentDataElement != null) {
_updateParentData(parentDataElement.widget as ParentDataWidget<ParentData>);
}
}Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consolefound in release: 3.7Found to occur in 3.7Found to occur in 3.7found in release: 3.9Found to occur in 3.9Found to occur in 3.9frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version