Rect class

An immutable, 2D, axis-aligned, floating-point rectangle whose coordinates are relative to a given origin.

Annotations
  • @immutable

Constructors

Rect.fromCircle(double x, double y, double r)
Creates a rectangle representing a circle with centerpoint x,yand radiusr`.
const
Rect.fromLTRB(double left, double top, double right, double bottom)
Creates a rectangle from the specified left, top, right, and bottom positions.
const
Rect.fromLTWH(double left, double top, double width, double height)
Creates a rectangle from the specified left and top positions with width and height dimensions.
const

Properties

bottom double
The y-axis offset of the bottom edge.
final
hashCode int
The hash code for this object.
no setteroverride
height double
The height of the rectangle.
no setter
isEmpty bool
Whether or not the rect has any contents.
no setter
left double
The x-axis offset of left edge.
final
The x-axis offset of the right edge.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
top double
The y-axis offset of the top edge.
final
width double
The width of the rectangle.
no setter

Methods

expanded(Rect other) Rect
Creates the smallest rectangle that covers the edges of this and other.
intersects(Rect other) bool
Whether or not other intersect this rectangle.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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

Constants

largest → const Rect
A rectangle covering the entire coordinate space, equal to dart:ui's definition.
zero → const Rect
A rectangle with the top, left, right, and bottom edges all at zero.