Skip to content

Conversation

@simonpham
Copy link

No description provided.

@joanpablo
Copy link
Owner

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@joanpablo
Copy link
Owner

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
Copy link

codecov bot commented Jun 14, 2025

Codecov Report

Attention: Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 95.40%. Comparing base (31e3018) to head (54cc8c5).
Report is 36 commits behind head on master.

Files with missing lines Patch % Lines
lib/src/validators/required_validator.dart 33.33% 4 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@joanpablo
Copy link
Owner

Hi @simonpham
It seems like there are still some issues to solve in the PR after the change. Plase take a look whenever you have the time, and let me know if you have any questions. Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants