Brush2D class

A 2D rectangular brush widget.

Brush2D allows the user to select a rectangular region by clicking and dragging.

Inheritance

Constructors

Brush2D({Key? key, required Widget child, void onBrushStart(Brush2DExtent extent)?, void onBrush(Brush2DExtent extent)?, void onBrushEnd(Brush2DExtent extent)?, void onBrushClear()?, Brush2DExtent? initialExtent, Color overlayColor = const Color(0x20000000), Color borderColor = const Color(0x80000000), double borderWidth = 1.0, double minSelectionSize = 5.0, bool movable = true, bool resizable = true, double handleSize = 10.0, bool clearOnDoubleTap = true})
Creates a Brush2D widget.
const

Properties

borderColor → Color
The color of the brush selection border.
final
borderWidth → double
The width of the brush selection border.
final
child → Widget
The child widget to render inside the brush area.
final
clearOnDoubleTap → bool
Whether to clear the selection on double-tap.
final
handleSize → double
The size of the resize handles.
final
hashCode → int
The hash code for this object.
no setterinherited
initialExtent → Brush2DExtent?
The initial extent of the brush.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
minSelectionSize → double
The minimum size of a brush selection.
final
movable → bool
Whether the brush selection can be moved.
final
onBrush → void Function(Brush2DExtent extent)?
Called when the brush selection changes.
final
onBrushClear → void Function()?
Called when the brush is cleared.
final
onBrushEnd → void Function(Brush2DExtent extent)?
Called when a brush selection is ended.
final
onBrushStart → void Function(Brush2DExtent extent)?
Called when a brush selection is started.
final
overlayColor → Color
The color of the brush selection overlay.
final
resizable → bool
Whether the brush selection can be resized.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<Brush2D>
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, int wrapWidth = 65}) → 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