feat: update RequiredValidator to support validate empty Map, List, S…#460
feat: update RequiredValidator to support validate empty Map, List, S…#460simonpham wants to merge 2 commits intojoanpablo:masterfrom
Conversation
…et, Iterable types
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request enhances the RequiredValidator to correctly identify empty collections (Map, List, Set, and other Iterables) as invalid, in addition to null and empty/whitespace-only strings. This is a useful enhancement for form validation. The implementation uses Dart's pattern matching, which is modern and appropriate.
A suggestion has been provided to simplify the code by removing redundant checks for List and Set types, as the existing Iterable check sufficiently covers these scenarios with the same logic.
For future pull requests, consider adding a brief description in the PR body to outline the changes and their rationale. It's also crucial to ensure that comprehensive unit tests are added to cover these new validation scenarios for empty collections, verifying the behavior for Map, List, Set, and other Iterable types.
|
Hi @simonpham Thank you for the PR, really appreciate it. If possible would you mind to address the suggestions whenever you have the time? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #460 +/- ##
==========================================
+ Coverage 95.02% 95.40% +0.38%
==========================================
Files 67 66 -1
Lines 1386 1394 +8
==========================================
+ Hits 1317 1330 +13
+ Misses 69 64 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hi @simonpham |
No description provided.