EasyValidator.compose constructor

const EasyValidator.compose(
  1. List<EasyValidator> validators
)

Composes multiple validators into a single validator.

The validators parameter is a list of EasyValidator instances that will be composed together. The resulting validator will apply each of the composed validators in the order they appear in the list. If any of the composed validators fail, the composed validator will also fail.

Example usage:

final validator = EasyValidator.compose([
  EasyValidator.required(),
  EasyValidator.minLength(8),
  EasyValidator.maxLength(20),
]);
String? result = validator.validate("");
print(result); // 'This field is required'

Implementation

const factory EasyValidator.compose(List<EasyValidator> validators) =
    _FormValidationCompose;