unfocus method

  1. @override
void unfocus(
  1. {bool touched = true}
)
override

Remove focus on a ReactiveFormField widget without the interaction of the user.

Example:

final formControl = form.formControl('name');

// UI text field lose focus
formControl.unfocus();

Implementation

@override
void unfocus({bool touched = true}) {
  if (hasFocus) {
    _updateFocusState(false);
  }

  if (touched == false) {
    markAsUntouched();
  }
}