RectData class

An axis-aligned rectangle in global logical pixels, mirrored from Flutter's Rect so the core stays free of any Flutter dependency.

Coordinates are global (screen-relative), which is what the geometry rules (target size, focus order) reason about.

Annotations
  • @immutable

Constructors

RectData({required double left, required double top, required double width, required double height})
Creates a rectangle from its left/top origin and width/height.
const
RectData.fromJson(Map<String, dynamic> json)
Parses a RectData from json.
factory
RectData.fromLTRB(double left, double top, double right, double bottom)
Creates a rectangle from its left, top, right and bottom edges.
const

Properties

bottom → double
The offset of the bottom edge from the origin.
no setter
hashCode → int
The hash code for this object.
no setteroverride
height → double
The height of the rectangle.
final
isEmpty → bool
Whether this rectangle has zero (or negative) area.
no setter
left → double
The offset of the left edge from the origin.
final
The offset of the right edge from the origin.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shortestSide → double
The length of the shorter of the two sides.
no setter
top → double
The offset of the top edge from the origin.
final
width → double
The width of the rectangle.
final

Methods

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

Operators

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

Constants

zero → const RectData
The zero-sized rectangle at the origin.