ResizerWidget class

A widget that wraps a child with resize handles and edge hit areas.

This widget provides 8 resize handles (corners and edge midpoints) around its child. Additionally, the entire edge is a valid resize target via invisible edge hit areas. All resize operations are delegated to callbacks, allowing the parent (typically a controller) to handle the actual resize logic.

Usage

ResizerWidget(
  handleSize: 10.0,
  color: Colors.white,
  borderColor: Colors.blue,
  borderWidth: 1.0,
  snapDistance: 4.0,
  onResizeStart: (handle) => controller.startResize(itemId, handle),
  onResizeUpdate: (delta) => controller.updateResize(delta),
  onResizeEnd: () => controller.endResize(),
  child: MyContent(),
)

Handle Positions and Edge Hit Areas

TL ─────── TC ─────── TR
│    [top edge]       │
│                     │
CL      child        CR
[left]         [right]
│                     │
│   [bottom edge]     │
BL ─────── BC ─────── BR

Each edge has an invisible hit area of snapDistance thickness for easy targeting. Corner and midpoint handles have additional snapDistance padding around them.

Inheritance
Available extensions

Constructors

ResizerWidget({Key? key, required Widget child, required OnResizeStart onResizeStart, required OnResizeUpdate onResizeUpdate, required OnResizeEnd onResizeEnd, double handleSize = 8.0, Color color = Colors.white, Color borderColor = Colors.blue, double borderWidth = 1.0, double snapDistance = 4.0})
const

Properties

borderColor Color
Border color of the resize handles.
final
borderWidth double
Border width of the resize handles.
final
child Widget
The content to wrap with resize handles.
final
color Color
Fill color of the resize handles.
final
handleSize double
Size of each visible resize handle.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onResizeEnd OnResizeEnd
Called when a resize operation ends.
final
onResizeStart OnResizeStart
Called when a resize operation starts.
final
onResizeUpdate OnResizeUpdate
Called during resize with the delta movement.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
snapDistance double
Additional hit area padding around handles and edge thickness.
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
withAnnotationLayer(NodeFlowController<T> controller) Widget

Available on Widget, provided by the AnnotationLayerSupport extension

Wraps this widget with an annotation layer.

Operators

operator ==(Object other) bool
The equality operator.
inherited