rydmike / flex_color_picker

A highly customizable Flutter color picker.
BSD 3-Clause "New" or "Revised" License
198 stars 41 forks source link

Set Default ColorPickerType #32

Closed imSaharukh closed 2 years ago

imSaharukh commented 2 years ago

is there a way I can set the default ColorPickerType?

image

but the wheel is opening by default image but I can't primary to open by default

imSaharukh commented 2 years ago

i was using this that's why

image

rydmike commented 2 years ago

Hi @imSaharukh, thanks for your question.

The picker will open on the page that has the color you pass to it when you open it. So if you have a box for selecting a color, and you click on it to open the picker, and pass that color it has to the picker when you open it, it will open the picker with the section (picker type) selected where it can first find the color you passed in, including any shade.

So if you passed it a color value that matched e.g. primary Red[200], that will be selected and the Primary picker shown.

If you pass it some custom color that does not exist in Material, Accent or in eg. custom colors you made for the custom tab, then it will always open the wheel and select the color there, that is if you have the wheel enabled.

If wheel is not enabled and there is no matching color on any of the enabled picker types, it will open the first picker type you have enabled.

BR Mike 😃