of method

InputFormState of (
  1. BuildContext context
)

Returns the closest InputFormState which encloses the given context.

Typical usage is as follows:

InputFormState _form = InputForm.of(context);
if ( _form.validate()) {
  _form.save();
}

Implementation

static InputFormState of(BuildContext context) {
  final _InputFormScope scope =
      context.dependOnInheritedWidgetOfExactType<_InputFormScope>();
  return scope?._formState;
}