requiredState<S extends State<StatefulWidget>> method

  1. @Deprecated('Will be removed')
Future<S> requiredState<S extends State<StatefulWidget>>()

Implementation

@Deprecated('Will be removed')
Future<S> requiredState<S extends State>() => requiredContext.then((value) {
      if (value is StatefulElement && value.state is S) {
        return value.state as S;
      }
      return Future<S>.value(value.findAncestorStateOfType<S>());
    });