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

Date of Birth component #21

Closed
royibernthal opened this issue Oct 19, 2019 · 7 comments
Closed

Date of Birth component #21

royibernthal opened this issue Oct 19, 2019 · 7 comments
Labels
enhancement New feature or request

Comments

@royibernthal
Copy link

royibernthal commented Oct 19, 2019

I'd like to create a date of birth component similar to the app Badoo - DD/MM/YYYY

This repo seems nearly perfect for it, except I'm not sure it supports 2 things I need:
-Custom Spaces - Spaces between DD, MM and YYYY.
-Text Hints - Each digit should have a hint until it's replaced with a digit. (e.g. DD/MM/YYYY -> typed 2 -> 2D/MM/YYYY)

For the spaces, I considered having 3 different components in a row, but at the very least backspace between components will like be an issue.

I suppose I could do it more easily with text masking, but it's just not as slick.

Are there any suggestions on how I can pull it off using this repo
Otherwise, if it's not currently possible, would you please take it as a request to add functionalities that'd allow implementing it?

@TinoGuo TinoGuo closed this as completed Oct 20, 2019
@TinoGuo TinoGuo reopened this Oct 20, 2019
@TinoGuo
Copy link
Owner

TinoGuo commented Oct 20, 2019

  1. I would add gapSpace collections to custom for a distance of two components, except BoxTightDecoration.
  2. Text hints is a good idea and will be implemented next version.

BTW, I would consider every single word as a component. This repo still is a Pin Input Widget not a General Input Widget.

@TinoGuo TinoGuo added the enhancement New feature or request label Oct 20, 2019
@royibernthal
Copy link
Author

Thanks for the willingness to help :)

  1. Not sure I understand. Flutter gapspace collection doesn't yield any relevant results on google, and I don't see anything of the sort in this repo's API. How would you do that?

  2. Perfect, thanks.

I did consider having each word as a component, however how would you solve backspace between components? For instance, I'm on the first digit of the second component, and when I press backspace I expect to now be focused on the first component. As far as I understand flutter doesn't support detecting backspace.

Frankly if I can make the spaces between digits when it's a single component, as well as add hints, I really have no reason to have multiple components, as it gives me just what I need.

@TinoGuo
Copy link
Owner

TinoGuo commented Oct 20, 2019

LOL, gapspace collections means List<int>.

In addition, every digit refer to a component but not a widget. In this repo, I'd like to add transparent textfield in the background to receive the text changes as well as focus. And I create a paint to control the display of text and border.

TinoGuo added a commit that referenced this issue Oct 20, 2019
@TinoGuo
Copy link
Owner

TinoGuo commented Oct 20, 2019

The final rendering if you run the latest code.
Screen Shot 2019-10-20 at 22 43 14

@TinoGuo TinoGuo closed this as completed Oct 20, 2019
@royibernthal
Copy link
Author

Oh. You meant you were going to add support for multiple gap spaces as well. Sorry, I didn't understand that.

Thanks a lot for adding support for both my requests :) Any idea when you'll push an official version to pub.dev?

@TinoGuo
Copy link
Owner

TinoGuo commented Oct 21, 2019

Maybe the next few days before 26th, I'd like to complete the unit test first.

@royibernthal
Copy link
Author

Got it, no problem.

TinoGuo added a commit that referenced this issue Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants