Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/src/validators/required_validator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@

if (control.value == null) {
return error;
} else if (control.value is String) {
return (control.value as String).trim().isEmpty ? error : null;
} else if (control.value case String string) {
return string.trim().isEmpty ? error : null;
} else if (control.value case Map value) {
return value.isEmpty ? error : null;
} else if (control.value case Iterable value) {
return value.isEmpty ? error : null;

Check warning on line 22 in lib/src/validators/required_validator.dart

View check run for this annotation

Codecov / codecov/patch

lib/src/validators/required_validator.dart#L19-L22

Added lines #L19 - L22 were not covered by tests
}

return null;
Expand Down
Loading