Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

flutter flutter logo hsv color picker

an hsv color picker inspired by chrome devtools and a material color picker for your flutter app.

devtools-like hsv color picker

getting started

installation

add this to your pubspec.yaml (or create it):

dependencies:
  flutter_colorpicker: any

then run the flutter tooling:

flutter packages get

or upgrade the packages with:

flutter packages upgrade

example

use it in [showdialog] widget:

// create some value
color pickercolor = color(0xff443a49);
color currentcolor = color(0xff443a49);
valuechanged<color> oncolorchanged;

// bind some values with [valuechanged<color>] callback
changecolor(color color) {
  setstate(() => pickercolor = color);
}

// raise the [showdialog] widget
showdialog(
  context: context,
  child: alertdialog(
    title: const text('pick a color!'),
    content: singlechildscrollview(
      child: colorpicker(
        pickercolor: pickercolor,
        oncolorchanged: changecolor,
        enablelabel: true,
        pickerareaheightpercent: 0.8,
      ),
      // use material color picker
      // child: materialpicker(
      //   pickercolor: pickercolor,
      //   oncolorchanged: changecolor,
      //   enablelabel: true, // only on portrait mode
      // ),
    ),
    actions: <widget>[
      flatbutton(
        child: text('got it'),
        onpressed: () {
          setstate(() => currentcolor = pickercolor);
          navigator.of(context).pop();
        },
      ),
    ],
  ),
)
01
02
03
04

download the full project for this post from the following button

this source is fully free for all time

download as zip


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

Comments are closed.