currentState property Null safety

T? currentState

The state for the unique inflated instance of this widget.

Might be null if the widget is not currently in the tree.

Implementation

T? get currentState {
  final GlobalKey<T> globalKey = key! as GlobalKey<T>;
  return globalKey.currentState;
}