flutter_colorpicker 0.3.4

Flutter Android iOS web

A HSV(HSB)/HSL color picker inspired by chrome devtools and a material color picker for your flutter app.

flutter_colorpicker #

pub package

A HSV(HSB)/HSL color picker inspired by chrome devtools and a material color picker for your flutter app.

Web Example

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,
      // ),
    ),
    actions: <Widget>[
      FlatButton(
        child: const Text('Got it'),
        onPressed: () {
          setState(() => currentColor = pickerColor);
          Navigator.of(context).pop();
        },
      ),
    ],
  ),
)

preview SlidePicker

Details in example/ folder.

109
likes
90
pub points
98%
popularity

A HSV(HSB)/HSL color picker inspired by chrome devtools and a material color picker for your flutter app.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

fnatic.roach@gmail.com

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_colorpicker