validateForm function
Validates a form based on the provided GlobalKey
Returns true if the form is valid, otherwise false.
Implementation
bool validateForm(GlobalKey<FormState> validateKey) {
if (validateKey.currentState!.validate()) {
validateKey.currentState!.save();
return true;
} else {
return false;
}
}