BarColorPicker class
A widget that allows users to pick colors from a gradient bar.
The BarColorPicker
widget provides a horizontal or vertical bar with a thumb that users can drag to select a color from a gradient.
Example Usage:
BarColorPicker(
pickMode: PickMode.color,
length: 200,
initialColor: Color(0xffff0000),
thumbColor: Colors.black,
colorListener: (colorValue) {
// Handle the selected color change here
},
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- BarColorPicker
Constructors
- BarColorPicker({Key? key, PickMode pickMode = PickMode.color, bool horizontal = true, bool showThumb = true, double length = 200, double borderWidth = 0.0, double cornerRadius = 0.0, double thumbRadius = 6, Color initialColor = const Color(0xffff0000), Color thumbColor = Colors.black, ValueChanged? onPositionChange, double? initPosition, required dynamic colorListener(int value), required ProImageEditorConfigs configs})
-
const
Properties
- borderWidth → double
-
The border width around the slider.
final
- colorListener → dynamic Function(int value)
-
A listener that receives color pick events.
final
- configs → ProImageEditorConfigs
-
Image editor configurations.
final
- cornerRadius → double
-
The corner radius of the picker bar for each corner.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- horizontal → bool
-
Specifies whether the bar is horizontal (
true
) or vertical (false
).final - initialColor → Color
-
The initial color to be displayed.
final
- initPosition → double?
-
The initial position of the thumb in the bar. If not provided, it will be estimated based on the gradient and an initial color.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- length → double
-
The width of the bar if it is horizontal, or the height if it is vertical.
final
- onPositionChange → ValueChanged?
-
Callback function that is called when the thumb position changes.
final
- pickMode → PickMode
-
The pick mode, which determines the available color options.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showThumb → bool
-
Show on the slider a thumb widget.
final
- thumbColor → Color
-
The fill color of the thumb.
final
- thumbRadius → double
-
The radius of the thumb.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< StatefulWidget> -
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