Slice class

A slice is a special kind of node that represents a section of the canvas that can be exported. Slices do not clip their children, and can contain children that are outside of their bounds.

Frames are similar to slices, but Frames typically contain and clip the child layers, have a background, effects, etc. Slices are just a lighter weight rectangular bound that exists outside of the hierarchy for exporting.

Inheritance
Available Extensions
Annotations
  • @JsonSerializable()
  • @CopyWith()

Constructors

Slice({required String id, required bool visible, Map<String, String>? componentPropertyReferences, double? rotation, String? name, String? type, dynamic pluginData, dynamic sharedPluginData, List<ExportSetting>? exportSettings, SizeRectangle? absoluteBoundingBox, SizeRectangle? absoluteRenderBounds, Vector2D? size, List<List<num>>? relativeTransform})
Slice.fromJson(Map<String, dynamic> json)
factory

Properties

absoluteBoundingBox SizeRectangle?
Bounding box of the node in absolute space coordinates.
final
absoluteRenderBounds SizeRectangle?
The bounds of the rendered node in the file in absolute space coordinates.
final
componentPropertyReferences Map<String, String>?
A mapping of a layer's property to component property name of component properties attached to this node. The component property name can be used to look up more information on the corresponding component's or component set's componentPropertyDefinitions.
finalinherited
exportSettings List<ExportSetting>?
An array of export settings representing images to export from this node.
final
hashCode int
The hash code for this object.
no setterinherited
id String
A string uniquely identifying this node within the document.
finalinherited
name String?
The name given to the node by the user in the tool.
finalinherited
pluginData → dynamic
Data written by plugins that is visible only to the plugin that wrote it. Requires the pluginData to include the ID of the plugin.
finalinherited
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setteroverride
relativeTransform List<List<num>>?
The top two rows of a matrix that represents the 2D transform of this node relative to its parent. The bottom row of the matrix is implicitly always (0, 0, 1). Use to transform coordinates in geometry. Only present if geometry=paths is passed.
final
rotation double?
The rotation of the node, if not 0.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sharedPluginData → dynamic
Data written by plugins that is visible to all plugins. Requires the pluginData parameter to include the string "shared".
finalinherited
size Vector2D?
Width and height of element. This is different from the width and height of the bounding box in that the absolute bounding box represents the element after scaling and rotation. Only present if geometry=paths is passed.
final
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
type String?
The type of the node. This is usually the same as the Node subtype classes (e.g. Frame, Component etc.), but can be different in the case of foreign nodes.
finalinherited
visible bool
Whether or not the node is visible on the canvas.
finalinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
override
toString() String
A string representation of this object.
inherited

Operators

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