of static method
Retrieves the nearest FormController from the widget tree.
Returns the FormController instance from the nearest Form ancestor. Throws an assertion error if no Form is found in the widget tree. Use maybeOf if the Form might not be present.
Parameters:
context(BuildContext): The build context to search from
Returns the FormController from the nearest Form ancestor.
Throws AssertionError if no Form is found in the widget tree.
Implementation
static FormController of(BuildContext context) {
return Data.of<FormController>(context);
}