validation method
Performs form validation.
This method sets the autoValidateMode to AutovalidateMode.onUserInteraction,
notifies listeners, and then calls the validate() method on the current form state.
Returns true if the form is valid, otherwise false.
Implementation
bool validation() {
autoValidateMode = AutovalidateMode.onUserInteraction;
notifyListeners();
return key.currentState!.validate();
}