WhiteboardToolbar class
Toolbar widget for the whiteboard providing drawing tools and controls.
This widget renders a horizontal toolbar with buttons for:
- Drawing mode selection (pan, draw, freehand, shapes, text, erase, select)
- Shape type selection
- Color picker
- Thickness controls
- Line type selection
- Undo/redo
- Zoom controls
- Background toggle
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- WhiteboardToolbar
Constructors
-
WhiteboardToolbar({Key? key, required WhiteboardMode currentMode, required WhiteboardShapeType currentShapeType, required Color currentColor, required double brushThickness, required double lineThickness, required double eraserThickness, required LineType lineType, required double fontSize, required bool useImageBackground, required bool canUndo, required bool canRedo, required ValueChanged<
WhiteboardMode> onModeChanged, required ValueChanged<WhiteboardShapeType> onShapeTypeChanged, required ValueChanged<Color> onColorChanged, required ValueChanged<double> onBrushThicknessChanged, required ValueChanged<double> onLineThicknessChanged, required ValueChanged<double> onEraserThicknessChanged, required ValueChanged<LineType> onLineTypeChanged, required ValueChanged<double> onFontSizeChanged, required VoidCallback onUndo, required VoidCallback onRedo, VoidCallback? onDeleteShape, bool hasSelectedShape = false, required VoidCallback onClear, required VoidCallback onZoomIn, required VoidCallback onZoomOut, required VoidCallback onResetZoom, required VoidCallback onToggleBackground, VoidCallback? onSave, VoidCallback? onUploadImage, required VoidCallback onToggleToolbar}) -
const
Properties
- brushThickness → double
-
Current brush thickness for freehand drawing.
final
- canRedo → bool
-
Whether redo is available.
final
- canUndo → bool
-
Whether undo is available.
final
- currentColor → Color
-
Current drawing color.
final
- currentMode → WhiteboardMode
-
Current drawing mode.
final
- currentShapeType → WhiteboardShapeType
-
Current shape type for shape mode.
final
- eraserThickness → double
-
Current eraser thickness.
final
- fontSize → double
-
Current font size for text.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasSelectedShape → bool
-
Whether a shape is currently selected.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- lineThickness → double
-
Current line thickness for shapes.
final
- lineType → LineType
-
Current line type.
final
-
onBrushThicknessChanged
→ ValueChanged<
double> -
Callback when brush thickness changes.
final
- onClear → VoidCallback
-
Callback for clear canvas action.
final
-
onColorChanged
→ ValueChanged<
Color> -
Callback when color changes.
final
- onDeleteShape → VoidCallback?
-
Callback for delete selected shape action.
final
-
onEraserThicknessChanged
→ ValueChanged<
double> -
Callback when eraser thickness changes.
final
-
onFontSizeChanged
→ ValueChanged<
double> -
Callback when font size changes.
final
-
onLineThicknessChanged
→ ValueChanged<
double> -
Callback when line thickness changes.
final
-
onLineTypeChanged
→ ValueChanged<
LineType> -
Callback when line type changes.
final
-
onModeChanged
→ ValueChanged<
WhiteboardMode> -
Callback when mode changes.
final
- onRedo → VoidCallback
-
Callback for redo action.
final
- onResetZoom → VoidCallback
-
Callback for reset zoom action.
final
- onSave → VoidCallback?
-
Callback for saving canvas as image.
final
-
onShapeTypeChanged
→ ValueChanged<
WhiteboardShapeType> -
Callback when shape type changes.
final
- onToggleBackground → VoidCallback
-
Callback for toggle background action.
final
- onToggleToolbar → VoidCallback
-
Callback for hiding the toolbar.
final
- onUndo → VoidCallback
-
Callback for undo action.
final
- onUploadImage → VoidCallback?
-
Callback for uploading image to canvas.
final
- onZoomIn → VoidCallback
-
Callback for zoom in action.
final
- onZoomOut → VoidCallback
-
Callback for zoom out action.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- useImageBackground → bool
-
Whether using image background.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< WhiteboardToolbar> -
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