validateLength method
validateLength method.
Implementation
Observable<String?> validateLength({int? min, int? max}) {
/// select method.
return select((value) {
/// Stores the =.
final length = value.length;
/// if method.
if (min != null && length < min) {
return 'Minimum $min characters required';
}
/// if method.
if (max != null && length > max) {
return 'Maximum $max characters allowed';
}
return null;
});
}