currentState property Null safety
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;
}