filling static method

Future<FormValidator> filling({
  1. required WebRequest rq,
  2. required String name,
  3. required Map data,
})

Creates and returns a FormValidator instance with empty validators for all fields in data.

Useful for initializing a validator instance without predefined validation rules.

Parameters:

  • rq: The web request object containing form data. (required)
  • name: The name of the form or validation context. (required)
  • data: A map representing the fields to validate. (required)

Returns a FormValidator instance.

Implementation

static Future<FormValidator> filling({
  required WebRequest rq,
  required String name,
  required Map data,
}) async {
  var fields = <String, List<ValidatorEvent>>{};
  for (var item in data.keys) {
    fields[item] = <ValidatorEvent>[];
  }

  final emptyValidator = FormValidator(rq: rq, fields: fields, name: name);
  await emptyValidator.validate(data: data);
  return emptyValidator;
}