Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual Hex Input (via TextEditingController) #54

Merged
merged 3 commits into from
Sep 2, 2021
Merged

Manual Hex Input (via TextEditingController) #54

merged 3 commits into from
Sep 2, 2021

Conversation

tsinis
Copy link
Contributor

@tsinis tsinis commented Aug 29, 2021

Hey, @mchome it's me again :)

I've added an optional, nullable hexInputController parameter to ColorPicker (which I believe can help you to close Issue #31 ), instead of providing some sort of TextField or changing ColorPickerLabel to editable. So it's not a breaking change.

It allows developers to add their own custom text fields with the ability to create tailor-made validators and formatters for them, from any place of theirs app. It's simply listening to this controller and do basic validation, via two new functions. Almost every line of code is commented on and documented. Also, 122 unit-tests for those two functions were added (since TextEditingController is well tested by Google already :)) and I did not add any widgets. However, I can add some widget tests if you wish to.

I'm open to any critics, and obviously, I'm ok if you don't like this approach, so you are free to close this PR.

Thanks again for your awesome color picker, the best one out there!

Best regards,
Roman

tsinis added 3 commits August 30, 2021 01:25
Also, added tests and documentation for utils it's using.
For backward compatibility across Flutter versions.
@tsinis
Copy link
Contributor Author

tsinis commented Aug 30, 2021

Additionally, I've removed the event type on addAllowedPointer, so it now has backward compatibility with all recent Flutter versions (uses PointerEvent at the stable channel and PointerDownEvent on beta/dev/master).

P.S.
The analyzer may complain about unknown isNot(null) in tests — just run flutter pub get

@mchome mchome merged commit 74d898e into mchome:master Sep 2, 2021
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