flutter_material_color_picker 0.0.4

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • new69

Flutter Material Color Picker

Material Color picker is a Flutter widget, that can be customizable.

By default, it's Material Colors, but you can define your own colors.

You can also use CircleColor widget to display color in your app. Example, you can set the color picker in a dialog and display the selected color in a ListTile, for settings.

How to use it

These examples use a static color for 'selectedColor', but you can use a variable (state)

Add to your Flutter project

You just need to add introduction_screen as a dependency in your pubspec.yaml file.

flutter_material_color_picker: ^0.0.3+1

Import

import 'package:flutter_material_color_picker/flutter_material_color_picker.dart';

Basic

MaterialColorPicker(
    onColorChange: (Color color) {
        // Handle color changes
    },
    selectedColor: Colors.red
)

Listen main color changes

MaterialColorPicker(
    onColorChange: (Color color) {
        // Handle color changes
    },
    onMainColorChange: (ColorSwatch color) {
        // Handle main color changes
    },
    selectedColor: Colors.red
)

Custom colors

In this example, custom colors are a list of Material Colors (class who extend of ColorSwatch). But you can create your own list of ColorSwatch.

MaterialColorPicker(
    onColorChange: (Color color) {
        // Handle color changes
    },
    selectedColor: Colors.red,
    colors: [
        Colors.red,
        Colors.deepOrange,
        Colors.yellow,
        Colors.lightGreen
    ]
)

Screenshot

Color selection

There is two step, first choose the main color, and when you press it, you have to choose a shade of the main color. By default it's all Material Colors, but you can define custom colors, a list of ColorSwatch.

Example of usages

You can insert the color picker into a Dialog

Display color

You can use CircleColor widget, to display the selected color into your settings for example.

0.0.4

  • Fix icon on selected color
  • Force icon's color (if light color set black icon, and if dark color set white icon)

0.0.3+1

  • Edit README

0.0.3

  • Improve design (use GridView)
  • Add (customizable) icon on CircleColor when selected

0.0.2

  • Add support of ColorSwatch and not MaterialColor
  • Fix bug of colors null
  • Fix bug if you just press main color, and not shade color, the change event not called
  • Improve code

0.0.1

  • Initial release

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_material_color_picker: ^0.0.4

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:flutter_material_color_picker/flutter_material_color_picker.dart';
  
Version Uploaded Documentation Archive
0.0.4 Sep 10, 2018 Go to the documentation of flutter_material_color_picker 0.0.4 Download flutter_material_color_picker 0.0.4 archive
0.0.3+1 Sep 10, 2018 Go to the documentation of flutter_material_color_picker 0.0.3+1 Download flutter_material_color_picker 0.0.3+1 archive
0.0.3 Sep 10, 2018 Go to the documentation of flutter_material_color_picker 0.0.3 Download flutter_material_color_picker 0.0.3 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
53
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
60
Overall:
Weighted score of the above. [more]
69
Learn more about scoring.

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

  • Dart: 2.0.0
  • pana: 0.12.3
  • Flutter: 0.8.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Suggestions

The description is too short.

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

Maintain an example.

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use flutter_material_color_picker.dart.

Package is pre-v0.1 release.

While there is nothing inherently wrong with versions of 0.0.*, it usually means that the author is still experimenting with the general direction of the API.

Format lib/flutter_material_color_picker.dart.

Run flutter format to format lib/flutter_material_color_picker.dart.

Format lib/src/colors.dart.

Run flutter format to format lib/src/colors.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.58.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