PaintedModel class

Represents a unit of shape or drawing information used in paint.

Constructors

PaintedModel.new({GlobalKey<State<StatefulWidget>>? key, required PaintMode mode, required List<Offset?> offsets, required List<ErasedOffset> erasedOffsets, required Color color, required double strokeWidth, required double opacity, bool fill = false, bool hit = false})
Creates a new PaintedModel instance.
PaintedModel.fromMap(Map<String, dynamic> map, {dynamic keyConverter(String key)?})
Factory constructor for creating a PaintedModel instance from a map.
factory

Properties

canBeFilled bool
Determines whether the current paint mode supports being filled.
no setter
color Color
The color used for drawing or filling the shape.
getter/setter pair
erasedOffsets List<ErasedOffset>
A list of offset points that have been erased from the painted content.
getter/setter pair
fill bool
A boolean indicating whether the drawn shape should be filled.
getter/setter pair
hashCode int
The hash code for this object.
no setteroverride
hit bool
A boolean flag indicating whether this unit of drawing has been hit.
getter/setter pair
id String
Unique id from the paint-model
latefinal
isCensorArea bool
Returns true if the current paint mode represents a censoring area.
no setter
key GlobalKey<State<StatefulWidget>>
A GlobalKey used to uniquely identify and access the widget associated with this model. This key can be used for retrieving the widget's state, context, or for other widget-related operations.
final
mode PaintMode
The mode of the paint method, indicating the type of shape or drawing.
final
offsets List<Offset?>
A list of offsets representing the points of the shape or drawing. For shapes like circles and rectangles, it contains two points. For FreeStyle, it contains a list of points.
getter/setter pair
opacity double
The opacity for the drawing.
getter/setter pair
paint Paint
Gets the Paint object configured based on the properties of this PaintedModel.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shouldFill bool
Determines whether the shape should be filled based on the paint mode.
no setter
strokeWidth double
The width of the stroke used for drawing.
getter/setter pair

Methods

copy() PaintedModel
Creates a copy of this PaintedModel instance.
copyWith({GlobalKey<State<StatefulWidget>>? key, PaintMode? mode, Color? color, double? strokeWidth, double? opacity, List<Offset?>? offsets, List<ErasedOffset>? erasedOffsets, bool? fill, bool? hit}) PaintedModel
Creates a copy of this PaintedModel with the given fields replaced by new values.
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Fills the given DiagnosticPropertiesBuilder with properties of this PaintedModel for debugging and development tools.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap({int maxDecimalPlaces = kMaxSafeDecimalPlaces, bool enableMinify = false}) Map<String, dynamic>
Converts the PaintedModel instance into a map.
toString() String
A string representation of this object.
inherited

Operators

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