OColorPicker class
Customizable color picker.
Typical usage is as follows:
OColorPicker(
selectedColor: Colors.white,
colors: primaryColorsPalette,
onColorChange: (color) => null,
);
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- OColorPicker
Constructors
-
OColorPicker({Key? key, List<
ColorSwatch> colors = primaryColorsPalette, required Color? selectedColor, required ValueChanged<Color> ? onColorChange, List<Color> excludedColors = const [], double spacing = 9.0, Size boxSize = const Size(40.0, 40.0), OColorBoxBorder boxBorder = const OColorBoxBorder()}) -
Creates an instance of OColorPicker
const
Properties
- boxBorder → OColorBoxBorder
-
Border of tiles of color picker.
final
- boxSize → Size
-
Size of tiles of color picker (height and width are equal).
final
-
colors
→ List<
ColorSwatch> -
Main palette of colors.
By default you can use primaryColorsPalette or accentColorsPalette
final
-
excludedColors
→ List<
Color> -
Excluded colors from main palette. It might be helpful
when user can choose colors of widgets which are close to each other
and you don't want to blend them by same color.
E.g. if user choose black as app's background and black as buttons colors,
buttons may go missing in the background.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onColorChange
→ ValueChanged<
Color> ? -
On color change callback.
E.g. save somewhere selected color and pop Navigator.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedColor → Color?
-
Currently selected color of given part of an app - e.g. app's background.
final
- spacing → double
-
Space between tiles of color picker.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _OColorPickerState -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of
DiagnosticsNode
objects describing this node's children.inherited -
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited