Search packages, repositories and app categories

flutter_material_color_picker cover
Package detailsv1.2.0

flutter_material_color_picker

Material color picker with some possible customizations for Flutter apps

AndroidiOSWebmacOSWindowsLinux
30-day downloads
4.3K
Likes
126
Pub points
150

Install package

flutter pub add flutter_material_color_picker

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter package that provides a Material-style color picker with customizable options for use in Flutter applications. It enables users to select colors from a visually appealing, material-designed interface, supporting integration across multiple platforms including Android, iOS, Web, macOS, Windows, and Linux. The picker offers flexibility through various customization settings, making it suitable for apps requiring intuitive color selection. It is built with Flutter's Material design principles for consistent UI experiences.

Use cases

  • Color selection in app themes
  • Customizing UI element colors
  • Design tool integrations
  • User preference settings
  • Interactive color palettes
  • Prototyping color schemes

Key features

  • Material design aesthetic
  • Cross-platform compatibility
  • Customizable appearance
  • Easy integration with Flutter
  • Supports color swatches
  • Responsive UI

Suitable for

  • UI/UX developers
  • App designers
  • Theme customization tools
  • Interactive prototyping
  • Color-sensitive applications

Considerations

  • Limited to Material design style
  • Requires manual handling of color state
  • No built-in color history
  • May need additional styling for non-Material themes
  • Depends on Flutter's Material library
  • Not optimized for complex color models

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Flutter Material Color Picker pub package

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 flutter_material_color_picker as a dependency in your pubspec.yaml file.

flutter_material_color_picker: ^1.2.0
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
)
Disallow Shades
MaterialColorPicker(
    allowShades: false, // default true
    onMainColorChange: (ColorSwatch color) {
        // Handle main color changes
    },
    selectedColor: Colors.red
)

If allowShades is set to false then only main colors will be shown and allowed to be selected. onColorChange will not be called, use onMainColorChange instead.

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.

Main color selection Shade color selection
Example of usages

You can insert the color picker into a Dialog

Example main color in a dialog Example shade color in a dialog
Display color

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

Example of circlecolor widget in ListTile

Categories

Source repository

Projects using this package