color_picker_palette 0.1.3

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

color_picker_palette 0.1.3

A color picker palette with custom colors.

Usage

Using color_picker_palette you can provide user with list of custom colors to choose.

It will show a horizontal list of colors including a button to add custom colors for user.

Long press will remove color from the list.

You can refer color_picker_palette/example

  colorPickerPalette = new ColorPickerPalette(
    size: 30.0,
    onChange: setColorState,
    colors: colors,
    buttonType: ButtonType.circular,
  );
  
  setColorState() {
    setState(() {
      color = colorPickerPalette.color();
    });
  }

Contributing

We encourage you contribute to color_picker_palette flutter package.

License

color_picker_palette is released under MIT License

0.1.3

  • Initial release

example/lib/main.dart

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

void main() => runApp(MyApp());

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

class MyAppState extends State<MyApp> {
  ColorPickerPalette colorPickerPalette;
  Color color;
  List<Color> colors = [];

  @override
  void initState() {
    super.initState();
    colors.add(Theme.of(context).primaryColor);
    colors.add(Colors.black);
    colors.add(Colors.white);
    color = colors[0];
    colorPickerPalette = new ColorPickerPalette(
      size: 30.0,
      onChange: setColorState,
      colors: colors,
      buttonType: ButtonType.circular,
    );
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          backgroundColor: color,
          title: Text(
            'Color Picker Palette',
            style: TextStyle(color: Color(color.value - 10010110)),
          ),
        ),
        body: new Container(
          constraints: BoxConstraints.expand(),
          color: color,
          child: new Column(
            children: <Widget>[
              colorPickerPalette,
              Container(
                padding: EdgeInsets.all(16.0),
                child: Text(
                  colorPickerPalette.color().toString(),
                  style: TextStyle(
                    fontSize: 24.0,
                    fontWeight: FontWeight.w400,
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }

  setColorState() {
    setState(() {
      color = colorPickerPalette.color();
    });
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  color_picker_palette: ^0.1.3

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:color_picker_palette/color_picker_palette.dart';
  
Version Uploaded Documentation Archive
0.1.3 Sep 26, 2018 Go to the documentation of color_picker_palette 0.1.3 Download color_picker_palette 0.1.3 archive
0.1.2 Sep 26, 2018 Go to the documentation of color_picker_palette 0.1.2 Download color_picker_palette 0.1.2 archive
0.1.1 Sep 26, 2018 Go to the documentation of color_picker_palette 0.1.1 Download color_picker_palette 0.1.1 archive
0.1.0 Sep 26, 2018 Go to the documentation of color_picker_palette 0.1.0 Download color_picker_palette 0.1.0 archive
0.0.2 Sep 20, 2018 Go to the documentation of color_picker_palette 0.0.2 Download color_picker_palette 0.0.2 archive
0.0.1 Sep 19, 2018 Go to the documentation of color_picker_palette 0.0.1 Download color_picker_palette 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
28
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
60
Learn more about scoring.

We analyzed this package on Oct 10, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.4
  • Flutter: 0.9.5

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/generated/i18n.dart.

Run flutter format to format lib/generated/i18n.dart.

Maintenance suggestions

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test