Skip to content

Commit 45a5d5e

Browse files
committed
Structure
1 parent 05d07ea commit 45a5d5e

27 files changed

+67
-51
lines changed

README.md

Lines changed: 54 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -51,98 +51,112 @@ URL, min, max, minLength, maxLength, minWordsCount, maxWordsCount, IP, credit ca
5151

5252
### Bool validators
5353

54-
- `FormBuilderValidators.hasSpecialChars()` - requires the field's to contain a specified number of special characters.
55-
- `FormBuilderValidators.hasUppercaseChars()` - requires the field's to contain a specified number of uppercase characters.
5654
- `FormBuilderValidators.hasLowercaseChars()` - requires the field's to contain a specified number of lowercase characters.
5755
- `FormBuilderValidators.hasNumericChars()` - requires the field's to contain a specified number of numeric characters.
58-
- `FormBuilderValidators.isTrue()` - requires the field's to be true.
56+
- `FormBuilderValidators.hasSpecialChars()` - requires the field's to contain a specified number of special characters.
57+
- `FormBuilderValidators.hasUppercaseChars()` - requires the field's to contain a specified number of uppercase characters.
5958
- `FormBuilderValidators.isFalse()` - requires the field's to be false.
59+
- `FormBuilderValidators.isTrue()` - requires the field's to be true.
6060

6161
### Collection validators
6262

6363
- `FormBuilderValidators.containsElement()` - requires the field's to be in the provided list.
64+
- `FormBuilderValidators.equalLength()` - requires the length of the field's value to be equal to the provided minimum length.
65+
- `FormBuilderValidators.maxLength()` - requires the length of the field's value to be less than or equal to the provided maximum size.
66+
- `FormBuilderValidators.minLength()` - requires the length of the field's value to be greater than or equal to the provided minimum length.
67+
- `FormBuilderValidators.range()` - requires the field's to be within a range.
6468
- `FormBuilderValidators.unique()` - requires the field's to be unique in the provided list.
6569

6670
### Core validators
6771

72+
- `FormBuilderValidators.aggregate()` - runs the validators in parallel, collecting all errors.
6873
- `FormBuilderValidators.compose()` - runs each validator against the value provided.
6974
- `FormBuilderValidators.conditional()` - conditionally runs a validator against the value provided.
70-
- `FormBuilderValidators.or()` - runs each validator against the value provided and passes when any works.
71-
- `FormBuilderValidators.transform()` - transforms the value before running the validator.
72-
- `FormBuilderValidators.aggregate()` - runs the validators in parallel, collecting all errors.
73-
- `FormBuilderValidators.log()` - runs the validator and logs the value at a specific point in the validation chain.
74-
- `FormBuilderValidators.skipWhen()` - runs the validator and skips the validation when a certain condition is met.
7575
- `FormBuilderValidators.defaultValue()` - runs the validator using the default value when the provided value is null.
7676
- `FormBuilderValidators.equal()` - requires the field's value to be equal to the provided object.
77+
- `FormBuilderValidators.log()` - runs the validator and logs the value at a specific point in the validation chain.
78+
- `FormBuilderValidators.notEqual()` - requires the field's value to be not equal to the provided object.
79+
- `FormBuilderValidators.or()` - runs each validator against the value provided and passes when any works.
7780
- `FormBuilderValidators.required()` - requires the field to have a non-empty value.
81+
- `FormBuilderValidators.skipWhen()` - runs the validator and skips the validation when a certain condition is met.
82+
- `FormBuilderValidators.transform()` - transforms the value before running the validator.
7883

7984
### Datetime validators
8085

81-
- `FormBuilderValidators.date()` - requires the field's value to be a valid date string.
82-
- `FormBuilderValidators.dateTime()` - requires the field's value to be a valid date time.
83-
- `FormBuilderValidators.dateRange()` - requires the field's value to be a within a date range.
84-
- `FormBuilderValidators.datePast()` - requires the field's value to be a in the past.
8586
- `FormBuilderValidators.dateFuture()` - requires the field's value to be in the future.
87+
- `FormBuilderValidators.datePast()` - requires the field's value to be a in the past.
88+
- `FormBuilderValidators.dateRange()` - requires the field's value to be a within a date range.
89+
- `FormBuilderValidators.dateTime()` - requires the field's value to be a valid date time.
90+
- `FormBuilderValidators.date()` - requires the field's value to be a valid date string.
8691
- `FormBuilderValidators.time()` - requires the field's value to be a valid time string.
8792

8893
### File validators
8994

90-
- `FormBuilderValidators.path()` - requires the field's to be a valid file or folder path.
9195
- `FormBuilderValidators.fileExtension()` - requires the field's value to a valid file extension.
92-
- `FormBuilderValidators.fileSize()` - requires the field's to be less than the max size.
9396
- `FormBuilderValidators.fileName()` - requires the field's to be a valid file name.
97+
- `FormBuilderValidators.fileSize()` - requires the field's to be less than the max size.
98+
- `FormBuilderValidators.path()` - requires the field's to be a valid file or folder path.
99+
100+
### Finance validators
101+
102+
- `FormBuilderValidators.bic()` - requires the field's to be a valid BIC.
103+
- `FormBuilderValidators.creditCardCVC()` - requires the field's value to be a valid credit card CVC number.
104+
- `FormBuilderValidators.creditCardExpirationDate()` - requires the field's value to be a valid credit card expiration date and can check if not expired yet.
105+
- `FormBuilderValidators.creditCard()` - requires the field's value to be a valid credit card number.
106+
- `FormBuilderValidators.iban()` - requires the field's to be a valid IBAN.
107+
108+
### Identity validators
109+
110+
- `FormBuilderValidators.password()` - requires the field's to be a valid password that matched required conditions.
111+
- `FormBuilderValidators.ssn()` - requires the field's to be a valid SSN (Social Security Number).
112+
- `FormBuilderValidators.username()` - requires the field's to be a valid username that matched required conditions.
113+
- `FormBuilderValidators.zipCode()` - requires the field's to be a valid zip code.
94114

95115
### Network validators
96116

97117
- `FormBuilderValidators.email()` - requires the field's value to be a valid email address.
98118
- `FormBuilderValidators.ip()` - requires the field's value to be a valid IP address.
99-
- `FormBuilderValidators.url()` - requires the field's value to be a valid URL.
100-
- `FormBuilderValidators.portNumber()` - requires the field's to be a valid port number.
101-
- `FormBuilderValidators.macAddress()` - requires the field's to be a valid MAC address.
102119
- `FormBuilderValidators.latitude()` - requires the field's to be a valid latitude.
103120
- `FormBuilderValidators.longitude()` - requires the field's to be a valid longitude.
121+
- `FormBuilderValidators.macAddress()` - requires the field's to be a valid MAC address.
122+
- `FormBuilderValidators.phoneNumber()` - requires the field's value to be a valid phone number.
123+
- `FormBuilderValidators.portNumber()` - requires the field's to be a valid port number.
124+
- `FormBuilderValidators.url()` - requires the field's value to be a valid URL.
104125

105126
### Numeric validators
106127

107-
- `FormBuilderValidators.integer()` - requires the field's value to be an integer.
108-
- `FormBuilderValidators.oddNumber()` - requires the field's to be an odd number.
109-
- `FormBuilderValidators.evenNumber()` - requires the field's to be an even number.
110128
- `FormBuilderValidators.between()` - requires the field's to be between two numbers.
129+
- `FormBuilderValidators.evenNumber()` - requires the field's to be an even number.
130+
- `FormBuilderValidators.integer()` - requires the field's value to be an integer.
111131
- `FormBuilderValidators.max()` - requires the field's value to be less than or equal to the provided number.
112-
- `FormBuilderValidators.maxLength()` - requires the length of the field's value to be less than or equal to the provided maximum size.
113-
- `FormBuilderValidators.maxWordsCount()` - requires the word count of the field's value to be less than or equal to the provided maximum count.
114132
- `FormBuilderValidators.min()` - requires the field's value to be greater than or equal to the provided number.
115-
- `FormBuilderValidators.minLength()` - requires the length of the field's value to be greater than or equal to the provided minimum length.
116-
- `FormBuilderValidators.minWordsCount()` - requires the word count of the field's value to be greater than or equal to the provided minimum count.
117-
- `FormBuilderValidators.equalLength()` - requires the length of the field's value to be equal to the provided minimum length.
118-
- `FormBuilderValidators.numeric()` - requires the field's value to be a valid number.
119-
- `FormBuilderValidators.positiveNumber()` - requires the field's to be a positive number.
120133
- `FormBuilderValidators.negativeNumber()` - requires the field's to be a negative number.
121134
- `FormBuilderValidators.notZeroNumber()` - requires the field's to be not a number zero.
135+
- `FormBuilderValidators.numeric()` - requires the field's value to be a valid number.
136+
- `FormBuilderValidators.oddNumber()` - requires the field's to be an odd number.
137+
- `FormBuilderValidators.positiveNumber()` - requires the field's to be a positive number.
122138

123139
### String validators
124140

125141
- `FormBuilderValidators.alphabetical()` - requires the field's to contain only alphabetical characters.
126-
- `FormBuilderValidators.match()` - requires the field's value to match the provided regex pattern.
127-
- `FormBuilderValidators.notMatch()` - requires the field's value to not match the provided regex pattern.
128-
- `FormBuilderValidators.uppercase()` - requires the field's value to be uppercase.
142+
- `FormBuilderValidators.contains()` - requires the substring to be in the field's value.
143+
- `FormBuilderValidators.endsWith()` - requires the substring to be the end of the field's value.
129144
- `FormBuilderValidators.lowercase()` - requires the field's value to be lowercase.
145+
- `FormBuilderValidators.matchNot()` - requires the field's value to not match the provided regex pattern.
146+
- `FormBuilderValidators.match()` - requires the field's value to match the provided regex pattern.
147+
- `FormBuilderValidators.maxWordsCount()` - requires the word count of the field's value to be less than or equal to the provided maximum count.
148+
- `FormBuilderValidators.minWordsCount()` - requires the word count of the field's value to be greater than or equal to the provided minimum count.
130149
- `FormBuilderValidators.singleLine()` - requires the field's string to be a single line of text.
150+
- `FormBuilderValidators.startsWith()` - requires the substring to be the start of the field's value.
151+
- `FormBuilderValidators.uppercase()` - requires the field's value to be uppercase.
131152

132153
### Use-case validators
133154

134-
- `FormBuilderValidators.creditCard()` - requires the field's value to be a valid credit card number.
135-
- `FormBuilderValidators.creditCardExpirationDate()` - requires the field's value to be a valid credit card expiration date and can check if not expired yet.
136-
- `FormBuilderValidators.creditCardCVC()` - requires the field's value to be a valid credit card CVC number.
137-
- `FormBuilderValidators.iban()` - requires the field's to be a valid IBAN.
138-
- `FormBuilderValidators.bic()` - requires the field's to be a valid BIC.
139-
- `FormBuilderValidators.isbn()` - requires the field's to be a valid ISBN.
140-
- `FormBuilderValidators.uuid()` - requires the field's to be a valid uuid.
141-
- `FormBuilderValidators.colorCode()` - requires the field's value to be a valid color code.
142155
- `FormBuilderValidators.base64()` - requires the field's to be a valid base64 string.
156+
- `FormBuilderValidators.colorCode()` - requires the field's value to be a valid color code.
157+
- `FormBuilderValidators.isbn()` - requires the field's to be a valid ISBN.
143158
- `FormBuilderValidators.json()` - requires the field's to be a valid json string.
144-
- `FormBuilderValidators.password()` - requires the field's to be a valid password that matched required conditions.
145-
- `FormBuilderValidators.zipCode()` - requires the field's to be a valid zip code.
159+
- `FormBuilderValidators.uuid()` - requires the field's to be a valid uuid.
146160

147161
## Extension methods used for chaining validators
148162

lib/form_builder_validators.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ export 'src/collection/collection.dart';
3737
export 'src/core/core.dart';
3838
export 'src/datetime/datetime.dart';
3939
export 'src/file/file.dart';
40+
export 'src/finance/finance.dart';
4041
export 'src/form_builder_validators.dart';
4142
export 'src/form_field_validator_extensions.dart';
43+
export 'src/identity/identity.dart';
4244
export 'src/network/network.dart';
4345
export 'src/numeric/numeric.dart';
4446
export 'src/string/string.dart';

lib/src/collection/collection.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ export 'contains_element_validator.dart';
22
export 'equal_length_validator.dart';
33
export 'max_length_validator.dart';
44
export 'min_length_validator.dart';
5+
export 'range_validator.dart';
56
export 'unique_validator.dart';

lib/src/finance/finance.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export 'bic_validator.dart';
2+
export 'credit_card_cvc_validator.dart';
3+
export 'credit_card_expiration_date_validator.dart';
4+
export 'credit_card_validator.dart';
5+
export 'iban_validator.dart';

0 commit comments

Comments
 (0)