Layer class

Represents a layer with common properties for widgets.

Implementers

Constructors

Layer.new({GlobalKey<State<StatefulWidget>>? key, String? id, LayerInteraction? interaction, Offset offset = Offset.zero, double rotation = 0, double scale = 1, bool flipX = false, bool flipY = false, Map<String, dynamic>? meta, BoxConstraints? boxConstraints, String? groupId})
Creates a new layer with optional properties.
Layer.fromMap(Map<String, dynamic> map, {List<Uint8List>? widgetRecords, WidgetLoader? widgetLoader, String? id, dynamic requirePrecache(EditorImage editorImage)?, EditorKeyMinifier? minifier})
Factory constructor for creating a Layer instance from a map and a list of stickers.
factory

Properties

boxConstraints BoxConstraints?
Optional constraints to temporarily limit the layer's dimensions.
getter/setter pair
flipX bool
Flags to control horizontal and vertical flipping.
getter/setter pair
flipY bool
Flags to control horizontal and vertical flipping.
getter/setter pair
groupId String?
Optional group identifier for grouping layers.
getter/setter pair
hashCode int
The hash code for this object.
no setteroverride
id String
A unique identifier for the layer.
getter/setter pair
interaction LayerInteraction
The interaction settings for the layer.
getter/setter pair
isEmojiLayer bool
Indicates whether this layer is an EmojiLayer.
no setter
isPaintLayer bool
Indicates whether this layer is a PaintLayer.
no setter
isTextLayer bool
Indicates whether this layer is a TextLayer.
no setter
isWidgetLayer bool
Indicates whether this layer is a WidgetLayer.
no setter
key GlobalKey<State<StatefulWidget>>
Global key associated with the Layer instance, used for accessing the widget tree.
getter/setter pair
keyInternalSize GlobalKey<State<StatefulWidget>>
A global key used to get the layer size.
getter/setter pair
meta Map<String, dynamic>?
A map containing metadata associated with the layer.
getter/setter pair
offset Offset
The position offset of the widget.
getter/setter pair
rotation double
The rotation and scale values of the widget.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scale double
The rotation and scale values of the widget.
getter/setter pair

Methods

computeLocalCenterOffset(Offset fractionalOffset) Offset
Computes the local offset within the render box using a fractional position relative to the center of the box (excluding the global offset).
computeOffsetFromCenterFraction(Offset fractionalOffset) Offset
Computes the global offset within the render box using a fractional position relative to the center of the box.
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Fills the given DiagnosticPropertiesBuilder with properties of this layer 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 this transform object to a Map.
toMapFromReference(Layer layer, {int maxDecimalPlaces = kMaxSafeDecimalPlaces, bool enableMinify = false}) Map<String, dynamic>
Converts the current layer to a map representation, comparing it with a reference layer.
toString() String
A string representation of this object.
inherited

Operators

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