debugIsValidRenderObject method Null safety

bool debugIsValidRenderObject(
  1. RenderObject renderObject

Checks if this widget can apply its parent data to the provided renderObject.

The RenderObject.parentData of the provided renderObject is typically set up by an ancestor RenderObjectWidget of the type returned by debugTypicalAncestorWidgetClass.

This is called just before applyParentData is invoked with the same RenderObject provided to that method.


bool debugIsValidRenderObject(RenderObject renderObject) {
  assert(T != dynamic);
  assert(T != ParentData);
  return renderObject.parentData is T;