depth property

int depth

An integer that is guaranteed to be greater than the parent's, if any. The element at the root of the tree must have a depth greater than 0.

Implementation

int get depth {
  assert(() {
    if (_lifecycleState == _ElementLifecycle.initial) {
      throw FlutterError('Depth is only available when element has been mounted.');
    }
    return true;
  }());
  return _depth;
}