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

Null value support #41

Open
vasilich6107 opened this issue Mar 4, 2021 · 1 comment
Open

Null value support #41

vasilich6107 opened this issue Mar 4, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@vasilich6107
Copy link

Hi. Thanks for your work.

I'm experimenting with wrapping BlockPicker to use as reactive_forms control.
It seems that BlockPicker lacks of null value support for pickerColor value.

The form initial state could be empty(if creating a new record) - currently pickerColor: null causes an error so it requires to make pickerColor: value ?? Colors.transparent.

The other thing is lack of uncheck support for the picker.

@mchome mchome added the enhancement New feature or request label Nov 16, 2021
@artoniaz
Copy link

My walk around is to pass to pickerColor any color value that isn't defined in your avaliableColors list.
However, my solution should thorw an error so I hope it's just a temporary solution.

Imo passing null value to pickerColor is a must, as starting with empy state is something obvoius.

Drowback of my solution.
In my case choosing a color is obligatory for a user. So primary I pass any random color that isn't on the list. On submiting the form I check if the valu has changed. You have to add such check also.

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

3 participants