Giter Club home page Giter Club logo

Comments (6)

stanchanpsu avatar stanchanpsu commented on August 16, 2024 2

Hey that makes sense. And your English is fine, never apologize.

Actually, what do you think about adding a property allowShades: bool so that the material_color_picker can be used with only the main colors if needed. We can then use the flag to determine the behavior of the callbacks too.

from flutter_material_color_picker.

Pyozer avatar Pyozer commented on August 16, 2024

I understand but, when you choose the main color, a shade color is automatically selected. Calling the onColorChange is useful when you use this color picker in a dialog, if the user choose the main color and after submit the dialog without select the shade color.

You can wrap it, store the current shade color and if the dialog is submit (and not canceled), return the color. You can check how I use it here: https://github.com/Pyozer/MyAgenda_Flutter/blob/master/lib/widgets/settings/list_tile_color.dart

Instead of remove the call of onColorChange when mainColor is chosen, we can add a parameter to call it or not.

If the onColorChange is not calling after the mainColor and the user just submit the dialog after chosen the mainColor, the color will be lost.

(Sorry if my english is not good 😆)

from flutter_material_color_picker.

Pyozer avatar Pyozer commented on August 16, 2024

Yeah it's a great idea, I will merge your PR ;)

from flutter_material_color_picker.

stanchanpsu avatar stanchanpsu commented on August 16, 2024

Awesome, I've updated the docs and change list. Let me know if there's any issues with it.

from flutter_material_color_picker.

Pyozer avatar Pyozer commented on August 16, 2024

Thank you for your PR, I merged it and publish new version to pub ;)
I also made a small fix for mainColor with selectedColor parameter.
Also, I add an example project with the package ;)

from flutter_material_color_picker.

stanchanpsu avatar stanchanpsu commented on August 16, 2024

Awesome. I can't wait to use it.

from flutter_material_color_picker.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.