flutter_colorpicker 0.0.3

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 48

flutter_colorpicker #

pub package

A HSV color picker for your flutter app.

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 = new Color(0xff443a49);
Color currentColor = new 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: new AlertDialog(
        title: const Text('Pick a color!'),
        content: new SingleChildScrollView(
            child: new ColorPicker(pickerColor: pickerColor, onColorChanged: changeColor),
        ),
        actions: <Widget>[
            new FlatButton(
                child: new Text('Got it'),
                onPressed: () {
                    setState(() => currentColor = pickerColor);
                    Navigator.of(context).pop();
                },
            ),
        ],
    ),
)

preview

Details in example/ folder.

I have created the ColorPicker widget so you can use the color picker out of the box. But you can create your own style with the CustomPaint.

CHANGELOG #

[0.0.3]

  • Optimization for responsibility design.

[0.0.2]

  • Change widget's width.

[0.0.1+1]

  • Update readme.

[0.0.1]

  • Initial release.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_colorpicker/flutter_colorpicker.dart';

main() => runApp(
      new MaterialApp(
        home: new Scaffold(
          appBar: new AppBar(
            title: const Text('Flutter Color Picker Example'),
          ),
          body: new MyApp(),
        ),
      ),
    );

class MyApp extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {
  Color pickerColor = new Color(0xff443a49);
  Color currentColor = new Color(0xff443a49);

  ValueChanged<Color> onColorChanged;

  changeColor(Color color) {
    setState(() {
      pickerColor = color;
    });
  }

  @override
  Widget build(BuildContext context) {
    return new Center(
      child: new RaisedButton(
        elevation: 3.0,
        onPressed: () {
          pickerColor = currentColor;
          showDialog(
            context: context,
            child: new AlertDialog(
              title: const Text('Pick a color!'),
              content: new SingleChildScrollView(
                child: new ColorPicker(
                    pickerColor: pickerColor, onColorChanged: changeColor),
              ),
              actions: <Widget>[
                new FlatButton(
                  child: new Text('Got it'),
                  onPressed: () {
                    setState(() => currentColor = pickerColor);
                    Navigator.of(context).pop();
                  },
                ),
              ],
            ),
          );
        },
        child: new Text('Change me'),
        color: currentColor,
        textColor: const Color(0xffffffff),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_colorpicker: ^0.0.3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_colorpicker/flutter_colorpicker.dart';
  
Version Uploaded Documentation Archive
0.2.4 May 19, 2019 Go to the documentation of flutter_colorpicker 0.2.4 Download flutter_colorpicker 0.2.4 archive
0.2.3 Apr 2, 2019 Go to the documentation of flutter_colorpicker 0.2.3 Download flutter_colorpicker 0.2.3 archive
0.2.2 Mar 7, 2019 Go to the documentation of flutter_colorpicker 0.2.2 Download flutter_colorpicker 0.2.2 archive
0.2.1 Jan 13, 2019 Go to the documentation of flutter_colorpicker 0.2.1 Download flutter_colorpicker 0.2.1 archive
0.2.0 Jan 9, 2019 Go to the documentation of flutter_colorpicker 0.2.0 Download flutter_colorpicker 0.2.0 archive
0.1.0 Oct 8, 2018 Go to the documentation of flutter_colorpicker 0.1.0 Download flutter_colorpicker 0.1.0 archive
0.0.7 Aug 20, 2018 Go to the documentation of flutter_colorpicker 0.0.7 Download flutter_colorpicker 0.0.7 archive
0.0.6 Aug 20, 2018 Go to the documentation of flutter_colorpicker 0.0.6 Download flutter_colorpicker 0.0.6 archive
0.0.5 May 24, 2018 Go to the documentation of flutter_colorpicker 0.0.5 Download flutter_colorpicker 0.0.5 archive
0.0.4 Mar 12, 2018 Go to the documentation of flutter_colorpicker 0.0.4 Download flutter_colorpicker 0.0.4 archive

All 14 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
95
Health:
Code health derived from static analysis. [more]
--
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
--
Overall:
Weighted score of the above. [more]
48
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://dart.dev/dart-2#migration.

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0