fix: use a count error text for Iterable and Map values in length validators#164
Open
Yusufihsangorgel wants to merge 3 commits into
Conversation
Author
|
Heads up: the build job was failing during the changelog link check before the tests ran, on a pre-existing empty link in the 8.4.0 section ( |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #164 +/- ##
=======================================
Coverage 99.20% 99.21%
=======================================
Files 95 95
Lines 1012 1019 +7
=======================================
+ Hits 1004 1011 +7
Misses 8 8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #81
MaxLengthValidatorandMinLengthValidatoraccept String, Iterable and Map values, but the default error text always talks about length in the string sense, which reads wrong for collections in languages like Japanese where the message says characters (文字).Changes, following the direction suggested in the issue:
maxCountErrorText/minCountErrorTextmessages. English in the template arb, Japanese with the wording proposed in the issue; other locales fall back to English through gen_l10n until translated, and land in the untranslated-messages report.errorTextwas given. Strings keep the existing length message, and a customerrorTextstill wins for every type.TranslatedValidatorgained ahasCustomErrorTextgetter so subclasses can tell whether the message was user-provided.Existing List tests were updated to the new default message, and new tests cover the count text for lists, the unchanged string text, and the custom-text override.
flutter testpasses (988) andflutter analyzereports no new issues.Left CHANGELOG and version to the release flow, as in previous PRs; happy to add an entry if you prefer.