A highly customizable Flutter color picker.
BSD-3-CLAUSE License
Bot releases are hidden (Show)
Published by rydmike 24 days ago
September 25, 2024
NEW
The ColorPicker got the following new properties and features:
Boolean showEditIconButton
, defaults to false
.
colorCodeReadOnly
is false. Tapping the icon button will focus the color code entry field.IconData editIcon
, defaults to Icons.edit
.
Boolean focusedEditHasNoColor
, defaults to false
.
colorCodeHasColor
, it makes it look and double like a big color indicator that shows the selected color. This can also make the edit of the color code confusing, as its color on purpose also changes as you edit and enter a new color value. If you find this behavior confusing and want to make the color code field always have no color during value entry, regardless of the selected color, then set this option to true.Boolean tonalPaletteFixedMinChroma
, defaults to false
.
FIX
ColorPickerCopyPasteBehavior.editUsesParsedPaste
had no impact on the picker's paste behavior when the color code text field was focused. The color picker always behaved as if this property was true. Which incidentally is the behavior that pretty much all uses cases should use. This feature now again works as stated in its doc comments. However, the default value was changed from false
to true
, to match the actual default behavior it has had since version 3.4.0, and the behavior that should be preferred. The false
setting was there to provide color code text field paste behavior backwards compatibility with versions before 2.0.0. We may deprecate this property in a future version, as it is not really recommended to use false
at all, but for now it is fixed again.TESTS
June 28, 2024
CHORE
Published by rydmike 5 months ago
May 15, 2024
Requires min Flutter 3.22.0.
No new features or fixes in this release. A version bump to use FlexSeedScheme 2.0.0 compatible with Flutter version 3.22.0 and its new breaking ColorScheme.
The ColorPicker contains no breaking changes, but underlying Flutter does, and this version is only compatible with Flutter 3.22.0 and later.
NEW
mainAxisSize
to ColorPicker
and showColorPickerDialog
, it controls the vertical axis size of the picker's column layout. Defaults to MainAxisSize.max
as before, like Columns
do by default. The property was added to enable setting the dialog to use MainAxisSize.min
if needed.FIX
ColorPicker
properties color
and onColorChanged
.Published by rydmike 5 months ago
May 13, 2024
Requires min Flutter 3.22.0 and Dart 3.4.0.
No new features or fixes in this release. A version bump to use FlexSeedScheme 2.0.0 compatible with Flutter version 3.22.0 and its new breaking ColorScheme.
The ColorPicker contains no breaking changes, but underlying Flutter does and this version is only compatible with Flutter 3.22.0 and later.
Published by rydmike 7 months ago
Mar 16, 2024
FIX
Package
tonalSubheading
in the convenience dialog function showColorPickerDialog
was never passed along to the ColorPicker
used to construct the dialog, causing the tonal sub heading to never show up in the resulting dialog.New
Web demo
showColorPickerDialog
function.Published by rydmike 8 months ago
Mar 3, 2024
Requires min Flutter 3.16.0 and Dart 3.0.0.
NEW
filled
and filledTonal
to ColorPickerActionButtonType
and added support for these button styles as OK/Cancel buttons in the ColorPicker dialog.dialogActionOnlyOkButton
to ColorPickerActionButtons
. Defaults to false. If set to true and dialogActionButtons
is true, only the OK button will be shown.ColorPickerType.custom
there is now also a ColorPickerType.customSecondary
picker selector. It gets its values from ColorPicker.customSecondaryColorSwatchesAndNames
.ColorPicker.enableOpacity
is not enabled. Nothing new is needed to use this feature. It works automatically when custom color palettes are used that have partially transparent colors in them.shadowColor
and surfaceTintColor
to the dialog properties to enable control of the shadow color and surface tint color of the color picker dialog.ColorTools.createPrimarySwatch
and ColorTools.createAccentSwatch
now create color swatches with alpha channel value kept at its input values for all created swatch indexes. Previously they set alpha to #FF
, even if the value might have been something else. Creating palettes with very low alpha in the source color will not produce pretty palettes, but it is now possible to create them.ColorPicker
property columnSpacing
. For two key elements, you can now override this spacing.
toolbarSpacing
to adjust the vertical spacing below the top toolbar header and its action buttons. The purpose is to enable using zero space or close to it, so the top toolbar and action buttons can be closer to the picker selection control than the rest of the spacing in the picker uses.shadesSpacing
to adjust the vertical spacing after the Material-2 swatch palette. By setting it to zero or one, you can create a design where the Material-2 swatch-based palette is closer to or connected to the Material-3 tonal palette. As long as the tonal palette does not use a heading, of course.toolbarSpacing
and shadesSpacing
default to columnSpacing
if they are not defined.CHANGE
.icon
Material button variants, when icon usage is enabled. Previously they baked in the leading icon into the button child Widget. This version follows the Material design spec exactly. The visual change is minor, but it does look better now when icons are used.FIX
Package
RawKeyboardListener
, RawKeyEvent
, RawKeyDownEvent
, RawKeyEventDataMacOs
, RawKeyEventDataIos
with Shortcut
APIs.InheritedTheme.capture
should use actionButtons.useRootNavigator
value and not default it to true. Fixed.Web demo
wheelSquarePadding
and wheelSquareBorderRadius
. Fixed.Published by rydmike 9 months ago
January 21, 2024
Published by rydmike over 1 year ago
July 18, 2023
NEW
ColorPicker.tonalColorSameSize
set to true, to make the Material-3 HCT tonal palette color indicators use the same size as the size defined for the other color indicators. Previously and by default, the tonal color indicators are smaller to make the palette width match the width of the Material-2 swatch color palette, that has fewer colors.FIX
Fixed issue #67 Inner circle does not move.
Fixed issue #66 White color selects multiple colors.
Published by rydmike over 1 year ago
May 11, 2023
flex_seed_scheme ^1.3.0
. This version, no longer depends on material_color_utilities
, thus avoiding all version issues and conflicts when Flutter changes what breaking version of material_color_utilities
it uses on different channels and versions.Published by rydmike over 1 year ago
Apr 16, 2023
flex_seed_scheme: ^1.2.4
that depends on material_color_utilities
with version constraint set to >=0.2.0 <0.4.0
from ^0.2.0
.
Published by rydmike over 1 year ago
Apr 2, 2023
NEW
ColorCodeField
as a part of the package's public API. It can now be used externally as well. The ColorCodeField
is the color code entry and display field used by the ColorPicker
.Published by rydmike over 1 year ago
Feb 1, 2023
CHANGE
Overlay.of
API. The new API is Overlay.maybeOf
. This forced a new release of FlexColorPicker that requires minimum Flutter 3.7 that breaks compatibility with older versions of Flutter.FIX
Published by rydmike almost 2 years ago
Jan 13, 2023
FIX
Published by rydmike almost 2 years ago
Jan 12, 2023
FIX
onColorChanged
was called twice if just clicking on the wheel color picker's wheel or square to set a new color value via a single click. This fixes it, and such clicks now only generate one onColorChanged
call-back. Dragging on the wheel and square still generate onColorChanged
call-backs during the entire drag process. To get callbacks just at start or end of drags, use onColorChangeStart
and onColorChangeEnd
as before.Published by rydmike almost 2 years ago
Nov 23, 2022
BREAKING - STYLE
The color picker dialog actionsPadding
now default to null. This results in that if it is undefined, its value is determined by the ambient AlertDialogTheme
, or if it is not defined either, the default for AlertDialog
. Which have different defaults depending on if Material 2 or Material 3 is used. Default value in previous versions of FlexColorPicker was: EdgeInsets.symmetric(horizontal: 16)
The color picker dialog buttonPadding
now default to null. This results in that if it is undefined, its value is determined by the ambient AlertDialogTheme
, or if it is not defined either, the default for AlertDialog
. Which have different defaults depending on if Material 2 or Material 3 is used. Default value in previous versions of FlexColorPicker was: EdgeInsets.all(16)
The API usage of the above properties is unchanged. It is only the default behavior that has been updated to be less opinionated and to enable using theme-dependent settings.
BREAKING - REMOVED
useRootNavigator
in ColorPicker
method showPickerDialog
.useRootNavigator
in function showColorPickerDialog
.NEW
To ColorPicker
method showPickerDialog
and to function showColorPickerDialog
, added parameters barrierLabel
and anchorPoint
as pass along values to Flutter SDK showDialog
and showGeneralDialog
.
To ColorPicker
method showPickerDialog
and to function showColorPickerDialog
added parameters transitionBuilder
and transitionDuration
. If transitionBuilder
is not null, the showPickerDialog
and showColorPickerDialog
will use the showGeneralDialog
Flutter SDK function instead of showDialog
. The showGeneralDialog
function will be used with the provided transitionBuilder
and transitionDuration
. The transitionDuration
only has any impact when the transitionBuilder
is used. If transitionBuilder
is null, then the showPickerDialog
and showColorPickerDialog
use the Flutter SDK showDialog
implementation as before, thus using the default Material platform dependent showDialog
transition and duration.
EXAMPLES
transitionBuilder
.ColorScheme
.Published by rydmike about 2 years ago
Sep 9, 2022
secondaryOffset
to OpacitySliderTrack
paint
method override to fix new requirement for master channel compatibility, works with stable channel too. Thanks Dan Reynolds for the PR.Published by rydmike about 2 years ago
Aug 30, 2022
August 28, 2022
CHANGE
This is a dev release that works with Flutter beta 3.3.0-0.5.pre and master channel.
It has more relaxed constraints than 2.6.0-dev.2.
This version no longer depends directly on package material_color_utilities
it uses
flex_seed_scheme
instead, with a transitive dependency on material_color_utilities
.
Changed all used TextTheme
style names to M3 versions, including docs.
August 21, 2022
CHANGE
This is a dev release for those that need to work with both master channel where Flutter master
SDK depends on material_color_utilities 0.2.0 and 3.3.0 beta, pre for upcoming Flutter 3.3.0
stable, use material_color_utilities 0.1.5. It uses a controversial package constraint of:
material_color_utilities: '>=0.1.5 <=0.2.0'
. Using older version 0.1.3 and 0.1.4 in theory
also works, but they contain some breaking color values in the used algorithm for calculation of
tonal palettes. The color changes are very minor and typically not visible to the eye.
This dev release also disabled two trivial tests that contained incompatible results between
Flutter 3.0.5 stable, 3.3.0-0.4.pre beta and 3.1.0-x master.
August 5, 2022
CHANGE
This is a dev release for those that need to work with master channel where Flutter SDK depends on
material_color_utilities ^0.2.0.
Updated material_color_utilities to ^0.2.0. This version constraint does not
work with Flutter 3.0.x stable or beta 3.3.x, and their earlier versions.
This dev release is required to use Flutter SDK master 3.1.0-0.0.pre.2111 or later,
that uses material_color_utilities 0.2.0.
For other (older) version of Flutter SDK you can use package version 2.5.0 that has a
material_color_utilities version constraint of ^0.1.3.
This release also updates Dart SDK constraint to '>=2.17.0 <3.0.0' and has Flutter listed as
'>=3.1.0-0.0.pre.2111'.
DOCS
Published by rydmike about 2 years ago
August 28, 2022
CHANGE
This is a dev release that works with Flutter beta 3.3.0-0.5.pre and master channel. It has more relaxed constraints than 2.6.0-dev.2.
This version no longer depends directly on package material_color_utilities
it uses flex_seed_scheme
instead, with a transitive dependency on material_color_utilities
.
Changed all used TextTheme
style names to M3 versions, including docs.
Published by rydmike about 2 years ago
August 21, 2022
This is a dev release for those that need to work with both master channel where Flutter master SDK depends on material_color_utilities 0.2.0 and 3.3.0 beta, pre for upcoming Flutter 3.3.0 stable, use material_color_utilities 0.1.5. It uses a controversial package constraint of:
material_color_utilities: '>=0.1.5 <=0.2.0'
. Using older version 0.1.3 and 0.1.4 in theory also works, but they contain some breaking color values in the used algorithm for calculation of tonal palettes. The color changes are very minor and typically not visible to the eye.
This dev release also disabled two trivial tests that contained incompatible results between Flutter 3.0.5 stable, 3.3.0-0.4.pre beta and 3.1.0-x master.
Published by rydmike about 2 years ago
August 5, 2022
This is a dev release for those that need to work with master channel where Flutter SDK depends on material_color_utilities ^0.2.0.
Updated material_color_utilities to ^0.2.0. This version constraint does not work with Flutter 3.0.x stable or beta 3.3.x, and their earlier versions. This dev release is required to use Flutter SDK master 3.1.0-0.0.pre.2111 or later, that uses material_color_utilities 0.2.0.
For other (older) version of Flutter SDK you can use package version 2.5.0 that has a material_color_utilities version constraint of ^0.1.3.
This release also updates Dart SDK constraint to '>=2.17.0 <3.0.0' and has Flutter listed as '>=3.1.0-0.0.pre.2111'.
DOCS