rydmike / flex_color_picker

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

tonalSubheading in dialog #80

Closed geovaniprodata closed 5 months ago

geovaniprodata commented 5 months ago

You guys forgot to insert tonalSubheading when use show color picker dialog, the ColorPicker itself use the parameter, but the dialog only declares him.

rydmike commented 5 months ago

Hi @geovaniprodata, this indeed a correct observation of minor bug. Good find, thank you! 😄

It has probably been left unnoticed for this long since very few actually uses the convenience function showColorPickerDialog. It should of course be fixed.

As you can see, your PR fails checks since it does not use dart format, which allows only max width 80 chars. Which is needed for packages on pub. Pub scoring check that packages uses dart format, and only with 80 chars line length, it does not understand anything else. If packages on pub do not pass dart format check loose some score points. Yes 80 chars is a silly low number for Flutter, I agree, but it it was pub requires for best score and there is no way to enforce other than 80 chars on project level.

Usually I would not approve a PR that has a lot of changes in updated file not related to the fix, one previously omitted line in this case. But since I can see it is the only thing that has actually been changed, I am going to merge it anyway.

The placement is also wrong, it should come after the subheading. I'm not going to nitpick about that either, I'll move it after merging.

Also need to create an issue for the PR that it fixes.

We should add tests for this particular dialog function and prop too, but that is something is a bit lacking anyway. I think I have the test for the ColorPicker that does it, but not via this showColorPickerDialog so I will add a case for that too.

rydmike commented 5 months ago

Added issue for this fix: https://github.com/rydmike/flex_color_picker/issues/81

rydmike commented 5 months ago

I also added to the Web demo a dialog that actually uses future function showColorPickerDialog. The existing demo only used "raw" CololPicker and its showPickerDialog method. And yes the tonal heading will not show up in that dialog dues to this issue 😄

rydmike commented 5 months ago

FIX: https://github.com/rydmike/flex_color_picker/issues/81