intl_phone_number_input icon indicating copy to clipboard operation
intl_phone_number_input copied to clipboard

validator .. needs refactoring

Open chickahoona opened this issue 1 year ago • 0 comments

I am sorry but this thing needs refactoring:

https://github.com/natintosh/intl_phone_number_input/blob/master/lib/src/widgets/input_widget.dart#L317-L337

So the default validator (presumably) should return null (if the validation passes) or an error message (if the validation fails).

  • This thing returns an error if "isValid==true". ... Which maniac wrote that? This code was presumambly written on opposite day?
  • Then by checking how isValid is contructed, one sees that "isValid" can only become true if "isNotValid" has been set true before....

chickahoona avatar May 05 '23 18:05 chickahoona