currentState property

State<StatefulWidget>? get currentState

The State of the Widget in the tree that has this Ref.

Implementation

State? get currentState {
  if (_currentNode is StatefulNode) {
    return (_currentNode as StatefulNode).state;
  } else {
    return null;
  }
}