isFormValid static method

bool isFormValid(
  1. GlobalKey<FormState>? formKey
)

Implementation

static bool isFormValid(GlobalKey<FormState>? formKey) {
  try {
    final FormState? form = formKey?.currentState;
    if (form != null) {
      if (form.validate()) {
        form.save();
        appLogsNS('$formKey isFormValid:true');
        return true;
      }
    } else {
      errorLogsNS('$formKey isFormValid[_formKey?.currentState] is NULL');
    }
  } on Exception catch (e, s) {
    errorLogsNS('$formKey isFormValid', e, s);
  }
  return false;
}