setupParentData method

  1. @override
void setupParentData (covariant RenderObject child)
override

Override to setup parent data correctly for your children.

You can call this function to set up the parent data for child before the child is added to the parent's child list.

Implementation

@override
void setupParentData(RenderObject child) {
  // We don't actually use the offset argument in BoxParentData, so let's
  // avoid allocating it at all.
  if (child.parentData is! ParentData)
    child.parentData = ParentData();
}