FormValidator constructor

FormValidator({
  1. required WebRequest rq,
  2. required Map<String, List<ValidatorEvent>> fields,
  3. required String name,
  4. Object failed = 'is-invalid',
  5. Object success = '',
  6. Map<String, Object> extraData = const {},
})

Constructor to initialize the FormValidator.

Parameters:

  • rq: The web request object containing form data. (required)
  • fields: A map of fields to validate with their respective validation rules. (required)
  • name: The name of the form or validation context. (required)
  • failed: The value to mark a field as invalid. (optional, defaults to 'is-invalid')
  • success: The value to mark a field as valid. (optional, defaults to an empty string)
  • extraData: Additional data to be considered during validation. (optional, defaults to an empty map)

Implementation

FormValidator({
  required this.rq,
  required this.fields,
  required this.name,
  this.failed = 'is-invalid',
  this.success = '',
  this.extraData = const {},
});