Refactoring of input_widget and validator, added ability to include padding below selector button #421
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.
I cleaned up the logic dealing with validation of input_widget, addressing the following: #385
As part of cleaning up the logic, I fixed the return type of the phone number utils validator (isValidNumber). The native code returns a boolean, so it should never be null anyway.
I added the ability to add padding below the country selector. This allows a consumer to fix an issue where the flag--when not used as a prefix icon--would jump up when a phone number validation error message displayed and caused the TextField to grow in height. The flag would jump up because more padding is added when the input_widget is in the error state. The consumer can now add padding and follow the work-around listed here (flutter/flutter#15400 (comment)) to keep both the flag and the phone input field fixed when error messages are displayed.
Some updates to the gradle version in the example also.