StacOffset class

A Stac representation of a 2D offset (displacement).

This class represents a displacement in 2D space with horizontal (dx) and vertical (dy) components. It's commonly used for positioning elements, defining shadow offsets, or specifying translation transformations.

{@tool snippet} Dart Example:

const StacOffset(dx: 10.0, dy: 20.0)

{@end-tool}

{@tool snippet} JSON Example:

{
  "dx": 10.0,
  "dy": 20.0
}

{@end-tool}

Implemented types
Annotations
  • @JsonSerializable()

Constructors

StacOffset.new({required double dx, required double dy})
Creates an offset with the specified horizontal and vertical displacements.
const
StacOffset.fromJson(Map<String, dynamic> json)
Creates a StacOffset from a JSON map.
factory

Properties

dx double
The horizontal displacement in logical pixels.
final
dy double
The vertical displacement in logical pixels.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Operators

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

Constants

zero → const StacOffset
A constant representing zero offset (no displacement).