WhiteboardShape class

Represents a shape on the whiteboard.

This class encapsulates all the properties needed to draw and serialize shapes on the whiteboard canvas.

Constructors

WhiteboardShape.new({required WhiteboardShapeType type, List<Offset>? points, Offset? start, Offset? end, String? text, required Color color, required double thickness, LineType lineType = LineType.solid, String? fontFamily, double? fontSize, Image? image, String? imageSrc})
WhiteboardShape.fromMap(Map<String, dynamic> map)
Creates a shape from a Map (socket data).
factory

Properties

color Color
Color of the shape.
final
end Offset?
End position for shapes.
final
fontFamily String?
Font family for text shapes.
final
fontSize double?
Font size for text shapes.
final
hashCode int
The hash code for this object.
no setterinherited
image Image?
Image data for image shapes.
final
imageSrc String?
Image source URL for serialization.
final
lineType LineType
Type of line (solid, dashed, dotted, dashDot).
final
points List<Offset>?
Points for freehand drawing.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
start Offset?
Start position for shapes.
final
text String?
Text content for text shapes.
final
thickness double
Thickness of the stroke.
final
type WhiteboardShapeType
The type of shape (freehand, line, rectangle, etc.).
final

Methods

copyWith({WhiteboardShapeType? type, List<Offset>? points, Offset? start, Offset? end, String? text, Color? color, double? thickness, LineType? lineType, String? fontFamily, double? fontSize, Image? image, String? imageSrc}) WhiteboardShape
Creates a copy of this shape with optional parameter overrides.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
Converts the shape to a Map for serialization (socket transmission).
toString() String
A string representation of this object.
inherited

Operators

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