FormModel constructor

FormModel(
  1. String type, {
  2. GlobalKey<FormFieldState>? key,
  3. bool? required,
  4. String? requiredError,
  5. FormFieldValidator<String>? validator,
  6. String? dataField,
  7. dynamic value,
})

Implementation

FormModel(this.type, {
  GlobalKey<FormFieldState>? key,
  bool? required,
  String? requiredError,
  FormFieldValidator<String>? validator,
  this.dataField,
  this.value
}) :
  key = key ?? GlobalKey<FormFieldState>(),
  required = required ?? false,
  validator = (validator == null && required == true) ? requiredValidator(requiredError) : validator;