resolveArtboard method Null safety

bool resolveArtboard()
inherited

Find the artboard in the hierarchy.

Implementation

bool resolveArtboard() {
  int sanity = maxTreeDepth;
  for (Component? curr = this;
      curr != null && sanity > 0;
      curr = curr.parent, sanity--) {
    visitAncestor(curr);
    if (curr is Artboard) {
      _changeArtboard(curr);
      return true;
    }
  }
  _changeArtboard(null);
  return false;
}