easy_color_picker 1.0.0 icon indicating copy to clipboard operation
easy_color_picker: ^1.0.0 copied to clipboard

Simple but flexible color picker to help you handle color selection

Easy Search Bar #

Buy Me A Pizza

A Flutter plugin to help you with color selection.<br/> A lightweight and flexible package that can be used inside any page or dialog

Preview #

Preview

Usage #

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  ...
  easy_color_picker: ^1.0.0

You can create a simple searchbar widget with the following example:

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

void main() {
  runApp(Example());
}

class Example extends StatefulWidget {
  @override
  State<Example> createState() => _ExampleState();
}

class _ExampleState extends State<Example> {
  Color _selectedColor = Colors.deepPurple;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: Text('Example'),
          backgroundColor: _selectedColor,
        ),
        body: Center(
          child: EasyColorPicker(
            selected: _selectedColor,
            onChanged: (color) => setState(() => _selectedColor = color)
          )
        )
      )
    );
  }
}

API #

AttributeTypeRequiredDescriptionDefault value
selectedColor✔️The current selected color from color picker
onChangedFunction(Color)✔️Function that returns the current selected color clicked by user
colorSelectorSizedoubleThe size for each color selector option30
colorSelectorBorderRadiusdoubleBorder radius for each color selector5
optionsMargindoubleMargin to applied between options2
selectedIconIconDataIcon to be displayed on top of current select color optionIcons.check_rounded
selectedIconSizedoubleIcon size for current selected color option20
selectedIconColorColorIcon color for current selected color optionColors.white
colorsList<Color>List of color to be displayed for selection[Colors.deepPurple, Colors.deepPurpleAccent, Colors.purple, Colors.purpleAccent, Colors.pinkAccent, Colors.pink, Colors.red, Colors.redAccent, Colors.deepOrange, Colors.deepOrangeAccent, Colors.orange, Colors.orangeAccent, Colors.amber, Colors.amberAccent, Colors.yellow, Colors.yellowAccent, Colors.green, Colors.lightGreen, Colors.lime, Colors.lightGreenAccent, Colors.greenAccent, Colors.lightBlueAccent, Colors.cyan, Colors.lightBlue, Colors.blue]

Issues & Suggestions #

If you encounter any issue you or want to leave a suggestion you can do it by filling an issue.

Other packages #

Thank you for the support! #

0
likes
130
pub points
33%
popularity

Publisher

verified publisher icon4inka.com

Simple but flexible color picker to help you handle color selection

Repository (GitHub)

Documentation

API reference

License

Icon for licenses.BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on easy_color_picker