validators icon indicating copy to clipboard operation
validators copied to clipboard

This library need a computed rule

Open hboran opened this issue 3 years ago • 1 comments

like this,

ComputedValidationRule("Password is not matching.", (text) {
   return pwdController.text ==pwdAgainController.text;
 },
)
class ComputedValidationRule extends TextValidationRule {

  bool Function(String text) computed;


  ComputedValidationRule(String? error, this.computed) : super(error);

  @override
  bool isValid(String input) => computed(input);
  
  @override
  String toString() => 'computedValidationRule';
}

hboran avatar Aug 23 '22 15:08 hboran

thanks , its great idea will add it ASAP

maxzod avatar Aug 23 '22 19:08 maxzod