StacRect class

A Stac representation of rectangles for geometric operations.

This class supports multiple construction methods for creating rectangles, including from coordinates, dimensions, center points, and circles. Different construction types use different parameter combinations.

{@tool snippet} Dart Example:

// Rectangle from coordinates
StacRect(
  rectType: StacRectType.fromLTRB,
  left: 10.0,
  top: 20.0,
  right: 100.0,
  bottom: 80.0,
)

{@end-tool}

{@tool snippet} JSON Example:

{
  "rectType": "fromLTRB",
  "left": 10.0,
  "top": 20.0,
  "right": 100.0,
  "bottom": 80.0
}

{@end-tool}

Implemented types
Annotations
  • @JsonSerializable()

Constructors

StacRect.new({required StacRectType rectType, double? left, double? top, double? right, double? bottom, double? width, double? height, StacOffset? center, double? radius, StacOffset? a, StacOffset? b})
Creates a rectangle using the specified construction method and parameters.
StacRect.fromJson(Map<String, dynamic> json)
Creates a StacRect from a JSON map.
factory

Properties

a StacOffset?
The first corner point (used with fromPoints).
final
b StacOffset?
The second corner point (used with fromPoints).
final
bottom double?
The bottom coordinate (used with fromLTRB).
final
center StacOffset?
The center point (used with fromCenter, fromCircle).
final
hashCode int
The hash code for this object.
no setterinherited
height double?
The height (used with fromLTWH, fromCenter).
final
left double?
The left coordinate (used with fromLTRB, fromLTWH).
final
radius double?
The radius (used with fromCircle).
final
rectType StacRectType
The method used to construct this rectangle.
final
The right coordinate (used with fromLTRB).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
top double?
The top coordinate (used with fromLTRB, fromLTWH).
final
width double?
The width (used with fromLTWH, fromCenter).
final

Methods

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

Operators

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