Removes the state referenced by ref from the scope.
ref
@override void clear<T>(StateRef<T> ref) { onClear?.call(ref); _states.remove(ref.key); }