HandDrawnStatusSquare class

A hand-drawn square that can be empty, filled, and overlaid with a status indicator (checkmark or dash).

This is a generic status control — it knows nothing about domain-specific enums like "completed" or "skipped". The consumer maps their own status model to color, isFilled, and indicator at the call site.

HandDrawnStatusSquare(
  color: Colors.green,
  isFilled: true,
  indicator: StatusIndicator.check,
  onTap: () => toggleStatus(),
)

When onTap is provided the square becomes interactive with an enlarged tap target for comfortable touch input. When null the widget is display-only.

Deterministic rendering

The border shape is fully determined by seed, segments, and irregularity. Identical parameters always produce the same border.

Inheritance

Constructors

HandDrawnStatusSquare({required Color color, bool isFilled = false, StatusIndicator indicator = StatusIndicator.none, Color indicatorColor = HandDrawnDefaults.statusSquareIndicatorColor, double size = HandDrawnDefaults.statusSquareSize, double scaleFactor = 1.0, VoidCallback? onTap, double tapPadding = HandDrawnDefaults.statusSquareTapPadding, int seed = HandDrawnDefaults.seed, double irregularity = HandDrawnDefaults.statusSquareIrregularity, int segments = HandDrawnDefaults.statusSquareSegments, double strokeWidth = HandDrawnDefaults.statusSquareStrokeWidth, double indicatorStrokeWidth = HandDrawnDefaults.statusSquareIndicatorStrokeWidth, Key? key})
Creates a hand-drawn status square.
const

Properties

color Color
The color used for both the border stroke and the fill (when isFilled is true).
final
hashCode int
The hash code for this object.
no setterinherited
indicator StatusIndicator
The indicator drawn on top of the filled square.
final
indicatorColor Color
The color of the indicator stroke.
final
indicatorStrokeWidth double
The width of the indicator (check / dash) stroke in logical pixels.
final
irregularity double
The roughness of the hand-drawn border.
final
isFilled bool
Whether the square is filled with color.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onTap VoidCallback?
When non-null, the square becomes tappable with an enlarged hit area surrounding the painted square.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scaleFactor double
A multiplier applied to size for accessibility scaling.
final
seed int
The random seed for deterministic border generation.
final
segments int
The number of linear segments per edge.
final
size double
The side length of the painted square in logical pixels.
final
strokeWidth double
The width of the border stroke in logical pixels.
final
tapPadding double
The padding added around the square to enlarge the tap target when onTap is non-null.
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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