Skip to content

Commit 211e308

Browse files
committed
Tweaked required logic to be slightly more efficient.
1 parent aee5999 commit 211e308

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/src/form_builder_validators.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ class FormBuilderValidators {
2525
}) {
2626
return (valueCandidate) {
2727
if (valueCandidate == null ||
28-
((valueCandidate is Iterable ||
29-
valueCandidate is String ||
28+
((valueCandidate is String ||
29+
valueCandidate is Iterable ||
3030
valueCandidate is Map) &&
31-
valueCandidate.length == 0)) {
31+
valueCandidate.isEmpty)) {
3232
return errorText ??
3333
FormBuilderLocalizations.of(context).requiredErrorText;
3434
}

0 commit comments

Comments
 (0)