markParentNeedsLayout method Null safety

  1. @protected
void markParentNeedsLayout()

Mark this render object's layout information as dirty, and then defer to the parent.

This function should only be called from markNeedsLayout or markNeedsLayoutForSizedByParentChange implementations of subclasses that introduce more reasons for deferring the handling of dirty layout to the parent. See markNeedsLayout for details.

Only call this if parent is not null.


void markParentNeedsLayout() {
  _needsLayout = true;
  assert(this.parent != null);
  final RenderObject parent = this.parent! as RenderObject;
  if (!_doingThisLayoutWithCallback) {
  } else {
  assert(parent == this.parent);