Skip to content

Commit 0487cce

Browse files
committed
Enhanced assertions with messages
1 parent 0f222cf commit 0487cce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/src/form_builder_validators.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class FormBuilderValidators {
179179
bool allowEmpty = false,
180180
String? errorText,
181181
}) {
182-
assert(minCount > 0);
182+
assert(minCount > 0, 'The minimum words count must be greater than 0');
183183
return (valueCandidate) {
184184
int valueWordsCount = 0;
185185

@@ -204,7 +204,7 @@ class FormBuilderValidators {
204204
int maxCount, {
205205
String? errorText,
206206
}) {
207-
assert(maxCount > 0);
207+
assert(maxCount > 0, 'The maximum words count must be greater than 0');
208208
return (valueCandidate) {
209209
int valueWordsCount = valueCandidate?.trim().split(' ').length ?? 0;
210210
return null != valueCandidate && valueWordsCount > maxCount

0 commit comments

Comments
 (0)