A beautiful circle color picker for flutter.

Overview

flutter_circle_color_picker

pub package

A beautiful circle color picker for flutter. Online Demo

Light theme Dark Theme
sample light theme sample dark theme

Usage

...
        body: Center(
          child: CircleColorPicker(
            initialColor: Colors.blue,
            onChanged: (color) => print(color),
            size: const Size(240, 240),
            strokeWidth: 4,
            thumbSize: 36,
          ),
        ),
...

API

  /// Called during a drag when the user is selecting a color.
  ///
  /// This callback called with latest color that user selected.
  final ValueChanged<Color> onChanged;

  /// Called when drag ended.
  ///
  /// This callback called with latest color that user selected.
  final ValueChanged<Color>? onEnded;

  /// An object to controll picker color dynamically.
  ///
  /// Provide initialColor if needed.
  final CircleColorPickerController? controller;

  /// The size of widget.
  /// Draggable area is thumb widget is included to the size,
  /// so circle is smaller than the size.
  ///
  /// Default value is 280 x 280.
  final Size size;

  /// The width of circle border.
  ///
  /// Default value is 2.
  final double strokeWidth;

  /// The size of thumb for circle picker.
  ///
  /// Default value is 32.
  final double thumbSize;

  /// Text style config
  ///
  /// Default value is Black
  final TextStyle textStyle;

  /// Widget builder that show color code section.
  /// This functions is called every time color changed.
  ///
  /// Default is Text widget that shows rgb strings;
  final ColorCodeBuilder colorCodeBuilder;
Comments
  • Request: Change color from external widget

    Request: Change color from external widget

    Use Case: User wants to see how a certain color code looks like. So he enters, e.g., a hex code and the color picker should show this color.

    Is it possible to inject a Color value to the picker?

    opened by S-Man42 10
  • Request: Option for custom text

    Request: Option for custom text

    Currently the color picker text shows the hex value of the chosen color, which, indeed, is a very useful default. But it would be great to get the possibility to change (maybe for showing RGB or HSL values) or even remove this text. Furthermore, with a custom text you could add a custom TextStyle for better app integration.

    Is is this possible yet? Or is there a chance to add a text attribute?

    opened by S-Man42 5
  • Color of thumb circle not equals underlying color

    Color of thumb circle not equals underlying color

    colorpicker colorpicker2

    As you can see at these screenshots, and even in your demo videos, in the range of light green and red, the thumb has not the same color as the underlying color of the circle (it is turqoise and pink instead). Maybe there's a slight shift of the hue values?

    opened by S-Man42 4
  • How to return color value on onChangeEnd?

    How to return color value on onChangeEnd?

    Awesome project! I want to use it for sending one end color. Right now it returns the value on dragging, is there a way to make it only returns a value when the drag finished(onPanEnd)? Thank you!

    class _ColorPicker extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return Center(
          child: CircleColorPicker(
            initialColor: Colors.blue,
            onChanged: (color) => print(color),
            size: const Size(300, 300),
            strokeWidth: 8,
            thumbSize: 35,
            textStyle: TextStyle(fontSize: 0),
          ),
        );
      }
    }
    
    opened by 0100101101001011 3
  • Flutter Web issue.

    Flutter Web issue.

    I am receiving the following in Flutter Web, I'm running the latest beta as of today 5/4/20.

    This is running the example after cloning the repo and I have done flutter pub get.

    ══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════

    The following UnimplementedError was thrown during a scheduler callback:

    UnimplementedError

    When the exception was thrown, this was the stack:

    dart-sdk/lib/internal/js_dev_runtime/private/ddc_runtime/errors.dart 195:49 throw

    lib/_engine/engine/shader.dart 52:5 createPaintStyle

    lib/_engine/engine/bitmap_canvas.dart 213:23 [_applyPaint]

    lib/_engine/engine/bitmap_canvas.dart 338:5 drawCircle

    lib/_engine/engine/surface/recording_canvas.dart 983:11 apply

    lib/_engine/engine/surface/recording_canvas.dart 79:18 apply

    lib/_engine/engine/surface/picture.dart 268:35 paintCallback

    lib/_engine/engine/surface/surface.dart 72:14 commitScene

    lib/_engine/engine/surface/scene_builder.dart 550:5 build

    packages/flutter/src/rendering/layer.dart 808:35 buildScene

    packages/flutter/src/rendering/view.dart 230:36 compositeFrame

    packages/flutter/src/rendering/binding.dart 406:18 drawFrame

    packages/flutter/src/widgets/binding.dart 884:13 drawFrame

    packages/flutter/src/rendering/binding.dart 284:5 [_handlePersistentFrameCallback]

    packages/flutter/src/scheduler/binding.dart 1113:15 [_invokeFrameCallback]

    packages/flutter/src/scheduler/binding.dart 1052:9 handleDrawFrame

    packages/flutter/src/scheduler/binding.dart 861:7

    dart-sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart 50:19 internalCallback

    ════════════════════════════════════════════════════════════════════════════════ ════════════════════

    Another exception was thrown: UnimplementedError

    Another exception was thrown: PersistedOffset: is in an unexpected state.

    Flutter Doctor -v returns... [✓] Flutter (Channel beta, v1.17.0-3.4.pre, on Mac OS X 10.15.4 19E287, locale en-US) • Flutter version 1.17.0-3.4.pre at /Users/jody/flutter/flutter • Framework revision e6b34c2b5c (2 days ago), 2020-05-02 11:39:18 -0700 • Engine revision 540786dd51 • Dart version 2.8.1

    [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at /Users/jody/Library/Android/sdk • Platform android-29, build-tools 29.0.2 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211) • All Android licenses accepted.

    [✓] Xcode - develop for iOS and macOS (Xcode 11.4.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.4.1, Build version 11E503a • CocoaPods version 1.9.0

    [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

    [✓] Android Studio (version 3.6) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 45.1.1 • Dart plugin version 192.7761 • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

    [✓] VS Code (version 1.44.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.10.1

    [✓] Connected device (3 available) • iPhone 8 Plus • D35F92EE-B051-455F-B0C0-EED7EE4225DE • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-4 (simulator) • Chrome • chrome • web-javascript • Google Chrome 81.0.4044.129 • Web Server • web-server • web-javascript • Flutter Tools

    opened by jodymac 2
  • Initial Color not being used

    Initial Color not being used

    Here is some code and a screen shot showing by usage. You can see in the picture that the container I put on the page is filled with the same value that I've set the intialColor value to but the control is not showing the color that was set.

     Column(
                  crossAxisAlignment: CrossAxisAlignment.center,
                  children: [
                    Text(
                      'Away Color',
                      style: TextStyle(
                        fontSize: 20.0,
                        fontWeight: FontWeight.bold,
                      )
                    ),
                    CircleColorPicker(
                      initialColor: awayPickerColor,
                      onChanged: (color) => changeAwayColor(color),
                      size: const Size(240, 240),
                      strokeWidth: 4,
                      thumbSize: 36,
                    ),
                    Container(width:100, height:20, color: awayPickerColor),
                  ]
                ),
    

    image

    opened by johnwiese-ms 2
  • Add onTap callback with splash to the centre circle

    Add onTap callback with splash to the centre circle

    @itome I love the simplicity of your widget.

    In my case though, I need to be able to "capture" clicks so I know when the user has finished with the widget and is ready to close the overlay, so I've added an optional onTap callback for the centre circle, and moved from a Container() to an InkWell() so that there's a splash effect when the circle is clicked (but only if there's an onTap callback).

    opened by j4m3s 0
  • Less an issue than a feature request

    Less an issue than a feature request

    Would it be crazy to implement a pick color by hex code feature, like users could tap the code to open a field and type a new one? Or would you be open to a pull request along those lines?

    opened by espbee 0
  • Added `disableLightnessSlider` and `disableColorCode` attributes

    Added `disableLightnessSlider` and `disableColorCode` attributes

    Added disableLightnessSlider and disableColorCode attributes to determine whether or not those Widgets should render. I am using this package to control an RGB LED and the lightness slider isn't needed and also the hex code may be confusing to some users.

    opened by austinn 0
  • Flutter Web displaying single color for entire ring

    Flutter Web displaying single color for entire ring

    CircleColorPicker( initialColor: Colors.blue, onChanged: (color) => {selectedColor = color}, size: const Size(240, 240), strokeWidth: 4, thumbSize: 36, )

    Screenshot 2020-12-31 at 2 18 25 PM

    opened by yogikorke 2
Similar to Weibo dynamics, WeChat circle of friends, nine grid view controls to display pictures. Support single big picture preview.

Similar to Weibo dynamics, WeChat circle of friends, nine grid view controls to display pictures. Support single big picture preview.

Flutter中国开源项目 296 Dec 28, 2022
Progress Dialog widget for flutter projects with ability to customize loading widget, background color and background blur.

DISCONTINUED Checkout ArsDialog ars_progress_dialog Customizable progress dialog for Flutter applications with smooth animation for background dim col

Arsam 8 Apr 15, 2022
The color of the widget is different with the counter application

GoldenTestのお試しをしてみた https://pub.dev/packages/golden_toolkit このライブラリを使って、検証する ちなみにマスターのスクリーンショットをGoldenというらしい。 カウンターアプリでWidgetのカラーが違う場合をテストしてみた OK想定 NG

MatsumaruTsusyoshi 0 Oct 18, 2021
An advanced switch widget, that can be fully customized with size, text, color, radius of corners.

flutter_advanced_switch An advanced switch widget, that can be fully customized with size, text, color, radius of corners. Switch Light Switch Dark Ge

Alex Melnyk 13 Dec 15, 2022
Love the material AppBar? Do you want to add more color to the appbar? Here's a gradientAppBar.

Gradient App Bar Love the material AppBar? Do you want to add more color to the appbar? Here's a gradientAppBar. It works just like the normal AppBar.

Joost Lekkerkerker 131 Nov 11, 2022
A flutter horizontal date picker that always shift the selected date to center.

horizontal_center_date_picker A flutter widget provides a horizontal date picker and always aligns selected date in center of the widget. Usage This s

May Lau 5 Jul 2, 2022
A flutter package for displaying common picker dialogs.

Flutter Material Pickers A flutter package containing commonly used material design picker dialogs. Some are new, some wrap existing or built in picke

CodeGrue 89 Jan 2, 2023
A time picker widget for flutter

time_picker A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if t

Ramon Alex 4 Dec 3, 2022
Flutter picker plugin

flutter_picker Flutter plugin picker. Include NumberPicker, DateTimePicker, ArrayPicker, and default linkage Picker. Provide flexible parameters to me

null 614 Dec 23, 2022
A Flutter Country Picker Widget with support to country dialing codes

flutter_country_picker A Flutter Country Picker Widget with support to country dialing codes Usage Add the CountryPicker widget in your layout and use

Alessandro Biessek 49 Apr 6, 2022
Flutter Number Picker is a custom widget designed for choosing an integer or decimal number by using add and minus buttons

Flutter Number Picker is a custom widget designed for choosing an integer or decimal number by using add and minus buttons. Getting Started Head to /p

Vũ Phương 2 Jul 4, 2022
A Highly customizable Phone input Flutter widget that supports country code, validation and contact picker.

A Highly customizable Phone input Flutter widget that supports country code, validation and contact picker.

null 6 Jun 7, 2022
An assets picker in WeChat style, support multi assets picking.

An assets picker in WeChat style, support multi assets picking.

FlutterCandies 1.1k Jan 8, 2023
A camera picker in WeChat style.

A camera picker which is an extension for wechat_assets_picker. Based on camera for camera functions and photo_manager for asset implementation.

FlutterCandies 265 Dec 28, 2022
starlight_country_picker is a country picker.

Starlight Country Picker starlight_country_picker is a country picker. Features ☑️ Add New Country ☑️ Search Your Country ⭐ Our package was not used s

Ye Myo Aung 1 Nov 29, 2021
Ejimo - Comprehensive emoji and symbol picker.

Ejimo Find and copy unicode characters, emoticons, glyphs and symbols with Ejimo. Ejimo is a comprehensive emoji and symbol piker that puts every char

null 20 Dec 19, 2022
Create beautiful Loading and Timer buttons in Flutter

Argon Buttons (Timer and Loading) Create beautiful Loading and Timer buttons using Argon Buttons. No need to worry about handling animations or timers

Yogesh 213 Dec 11, 2022
Powerful Complete and Beautiful Search Component for Flutter

A highly customizable search component to accelerate your development. Overview There are many search or search components for Flutter, however this o

Tiagosito 31 Jul 27, 2022
Create beautiful flutter tags quickly and easily

flutter_tags Create beautiful tags quickly and easily. Installing Add this to your package's pubspec.yaml file: Null-safety version (Beta) MORE INFO d

null 2 Mar 4, 2022