ExtendedBuildContext extension

on

Methods

clearFocus() → void

Available on BuildContext, provided by the ExtendedBuildContext extension

Clear current context focus. This is the cleanest, official way.
validateForm({VoidCallback? onValidated, bool scrollToFirstInvalid = false}) → bool

Available on BuildContext, provided by the ExtendedBuildContext extension

Validate the enclosing Form, and save it if valid. Returns whether the form is valid, like FormState.validate. onValidated is called if the form is valid, after it has been saved. If scrollToFirstInvalid is true and validation fails, scrolls to the first invalid field.