constraints property Null safety

Constraints constraints

The layout constraints most recently supplied by the parent.

If layout has not yet happened, accessing this getter will throw a StateError exception.

Implementation

@protected
Constraints get constraints {
  if (_constraints == null) {
    throw StateError('A RenderObject does not have any constraints before it has been laid out.');
  }
  return _constraints!;
}