Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

This library need a computed rule #42

Open
hboran opened this issue Aug 23, 2022 · 1 comment
Open

This library need a computed rule #42

hboran opened this issue Aug 23, 2022 · 1 comment

Comments

@hboran
Copy link

hboran commented Aug 23, 2022

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';
}
@maxzod
Copy link
Member

maxzod commented Aug 23, 2022

thanks , its great idea will add it ASAP

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants