-
- Notifications
You must be signed in to change notification settings - Fork 103
Add some features and more tests #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add some features and more tests #103
Conversation
Maybe in this MR can add the think that I commented here #101 (review) Validate a lot the all validators, is something important before publish a new version |
@deandreamatias I can look into faker_dart but for now would first like to implement the current tests and get a release out. Are you adding it in #104 ? |
We can add the two things. |
@deandreamatias I've done a couple of fixes but one thing i notice is inconsistency in handling What is your opinion? |
@deandreamatias This one is finished now. I would prefer to refactor the inconsistency in handling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can define macro templates for regex (lib/src/utils/validators.dart) and add to validator dart doc to give more context
Example:
/// {@template hex_template} /// This regex match with /// /// - Starts with a # character. /// - Is followed by exactly six characters, each of which is a hexadecimal digit (0-9, a-f, or A-f). /// - Has no additional characters before or after this pattern. /// /// Examples: #1a2b3c and #ABCDEF /// {@endtemplate} RegExp _hex = RegExp(r'^#[0-9a-fA-F]{6}$')
/// {@macro hex_template} static FormFieldValidator<String> colorCode({
@martijn00 I don't know if empty string or null should be pass on validation. Maybe not. |
Remember to use all templates create, like macro on validators /// {@macro hex_template} static FormFieldValidator<String> colorCode({ |
@deandreamatias thanks! I'll have a look at the null checks next. In general I think the behaviour should be that if a value is null or empty it should show the error message, right? |
Connection with issue(s)
Solution description
I've added a bunch of tests. There are some issues with null checks etc that should be fixed.
Screenshots or Videos
To Do