Text class

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

Constructors

Text({String? characters, TypeStyle? style, List<int>? characterStyleOverrides, Map<int, TypeStyle>? styleOverrideTable, required String id, String? name, required bool visible, dynamic pluginData, dynamic sharedPluginData, bool? locked, List<ExportSetting>? exportSettings, BlendMode? blendMode, bool? preserveRatio, LayoutAlign? layoutAlign, double? layoutGrow, LayoutConstraint? constraints, String? transitionNodeID, double? transitionDuration, EasingType? transitionEasing, double? opacity, SizeRectangle? absoluteBoundingBox, List<Effect>? effects, Vector2D? size, List<List<num>>? relativeTransform, bool? isMask, List<Paint>? fills, List? fillGeometry, List<Paint>? strokes, double? strokeWeight, StrokeCap? strokeCap, StrokeJoin? strokeJoin, List<double>? strokeDashes, double? strokeMiterAngle, List? strokeGeometry, StrokeAlign? strokeAlign, Map<StyleTypeKey, String>? styles})
Text.fromJson(Map<String, dynamic> json)
factory

Properties

absoluteBoundingBox SizeRectangle?
Bounding box of the node in absolute space coordinates
finalinherited
blendMode BlendMode?
How this node blends with nodes behind it in the scene (see BlendMode)
finalinherited
characters String?
Text contained within text box
final
characterStyleOverrides List<int>?
Array with same number of elements as characeters in text box, each element is a reference to the styleOverrideTable defined below and maps to the corresponding character in the characters field. Elements with value 0 have the default type style
final
constraints LayoutConstraint?
Horizontal and vertical layout constraints for node
finalinherited
effects List<Effect>?
An array of effects attached to this node (see Effect)
finalinherited
exportSettings List<ExportSetting>?
An array of export settings representing images to export from node
finalinherited
fillGeometry List?
Only specified if parameter geometry=paths is used. An array of paths representing the object fill
finalinherited
fills List<Paint>?
An array of fill paints applied to the node
finalinherited
hashCode int
The hash code for this object.
no setterinherited
id String
A string uniquely identifying this node within the document.
finalinherited
individualStrokeWeights StrokeWeights?
The weight of strokes on the node per side, if they vary
finalinherited
isMask bool?
Does this node mask sibling nodes in front of it?
finalinherited
layoutAlign LayoutAlign?
How the layer is aligned inside an auto-layout frame. This property is only provided for direct children of auto-layout frames.
finalinherited
layoutGrow double?
This property is applicable only for direct children of auto-layout frames, ignored otherwise. Determines whether a layer should stretch along the parent’s primary axis. A 0 corresponds to a fixed size and 1 corresponds to stretch
finalinherited
locked bool?
If true, layer is locked and cannot be edited
finalinherited
name String?
The name given to the node by the user in the tool.
finalinherited
opacity double?
Opacity of the node
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
preserveRatio bool?
Keep height and width constrained to same ratio
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
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
finalinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
strokeAlign StrokeAlign?
Position of stroke relative to vector outline
finalinherited
strokeCap StrokeCap?
A string enum with value of StrokeCap.none, StrokeCap.round, StrokeCap.squary, StrokeCap.lineArrow or StrokeCap.triangleArrow, describing the end caps of vector paths.
finalinherited
strokeDashes List<double>?
An array of floating point numbers describing the pattern of dash length and gap lengths that the vector path follows. For example a value of 1, 2 indicates that the path has a dash of length 1 followed by a gap of length 2, repeated.
finalinherited
strokeGeometry List?
Only specified if parameter geometry=paths is used. An array of paths representing the object stroke
finalinherited
strokeJoin StrokeJoin?
A string enum with value of StrokeJoin.miter, StrokeJoin.bevel, or StrokeCap.round, describing how corners in vector paths are rendered.
finalinherited
strokeMiterAngle double?
Only valid if strokeJoin is StrokeJoin.miter. The corner angle, in degrees, below which strokeJoin will be set to StrokeJoin.bevel to avoid super sharp corners. By default this is 28.96 degrees.
finalinherited
strokes List<Paint>?
An array of stroke paints applied to the node
finalinherited
strokeWeight double?
The weight of strokes on the node
finalinherited
style TypeStyle?
Style of text including font family and weight (see TypeStyle)
final
styleOverrideTable Map<int, TypeStyle>?
Map from ID to TypeStyle for looking up style overrides
final
styles Map<StyleTypeKey, String>?
A mapping of a StyleType to style ID (see Style) of styles present on this node. The style ID can be used to look up more information about the style in the top-level styles field.
finalinherited
transitionDuration double?
The duration of the prototyping transition on this node (in milliseconds)
finalinherited
transitionEasing EasingType?
The easing curve used in the prototyping transition on this node
finalinherited
transitionNodeID String?
Node ID of node to transition to in prototyping
finalinherited
type String?
The type of the node
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