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_colorpicker

a hsv(hsb)/hsl color picker inspired by chrome devtools and a material color picker for your flutter app.

getting started

use it in [showdialog] widget:

// create some values
color pickercolor = color(0xff443a49);
color currentcolor = color(0xff443a49);

// valuechanged<color> callback
void 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,
        showlabel: true,
        pickerareaheightpercent: 0.8,
      ),
      // use material color picker:
      //
      // child: materialpicker(
      //   pickercolor: pickercolor,
      //   oncolorchanged: changecolor,
      //   showlabel: true, // only on portrait mode
      // ),
      //
      // use block color picker:
      //
      // child: blockpicker(
      //   pickercolor: currentcolor,
      //   oncolorchanged: changecolor,
      // ),
      //
      // child: multiplechoiceblockpicker(
      //   pickercolors: currentcolors,
      //   oncolorschanged: changecolors,
      // ),
    ),
    actions: <widget>[
      flatbutton(
        child: const text('got it'),
        onpressed: () {
          setstate(() => currentcolor = pickercolor);
          navigator.of(context).pop();
        },
      ),
    ],
  ),
)

36585408-bb4e96a4-18b8-11e8-8c20-d4dc200e1a7c

74600957-5efa3980-50d3-11ea-9458-55842927e565

46619114-de790f80-cb53-11e8-81c8-278d4dc51606

57980467-c577fb80-7a5e-11e9-85ee-033963b48162

46619111-dd47e280-cb53-11e8-9701-38900857321f

50912123-56fdae00-146c-11e9-8d63-be3a26a20b72

46619116-df11a600-cb53-11e8-8b6b-4e495f8dbea9

57980469-c6109200-7a5e-11e9-8c32-5f4ba74c88da

46619112-dde07900-cb53-11e8-91d9-a4d1ee70cf3b

57980462-b8f3a300-7a5e-11e9-95e4-1748b14793ae


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.