FormValidator constructor
FormValidator({})
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 {},
});