state property

T? get state

Do that:

return key.currentState

Implementation

T? get state => currentState;