of static method

FormState? of(
  1. BuildContext context
)

Retrieves the closest ancestor FormState in the tree.

Implementation

static FormState? of(BuildContext context) {
  final scope = context.dependOnInheritedWidgetOfExactType<FormScope>();
  return scope?.formState;
}