Holds a 2D floating-point size.
You can think of this as a vector from Point(0,0) to Point(size.width, size.height).
- Inheritance
- Object
- OffsetBase
- Size
Constants
Static Methods
Constructors
- Size(double width, double height)
-
Creates a Size with the given width and height.
const - Size.copy(Size source)
-
Creates an instance of Size that has the same values as another.
- Size.fromHeight(double height)
-
Creates a Size with the given height and an infinite width.
const - Size.fromRadius(double radius)
-
Creates a square Size whose width and height are twice the given dimension.
const - Size.fromWidth(double width)
-
Creates a Size with the given width and an infinite height.
const - Size.square(double dimension)
-
Creates a square Size whose width and height are the given dimension.
const
Properties
- height → double
-
The vertical extent of this size.
read-only - isEmpty → bool
-
Whether this size encloses a non-zero area.
read-only - shortestSide → double
-
The lesser of the
width
and theheight
.read-only - width → double
-
The horizontal extent of this size.
read-only - hashCode → int
-
read-only, inherited
- isInfinite → bool
-
Returns true if either dimension is
double.INFINITY
, and false if both are finite (or negative infinity, or NaN).read-only, inherited - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Operators
-
operator %(
double operand) → Size -
Modulo (remainder) operator. Returns a size whose dimensions are the remainder of dividing the left-hand-side operand (a Size) by the scalar right-hand-side operand (a double).
-
operator *(
double operand) → Size -
Multiplication operator. Returns a size whose dimensions are the dimensions of the left-hand-side operand (a Size) multiplied by the scalar right-hand-side operand (a double).
-
operator +(
Offset other) → Size -
Binary addition operator for adding an Offset to a Size. Returns a Size whose width is the sum of the width of the left-hand-side operand, a Size, and the Offset.dx dimension of the right-hand-side operand, an Offset, and whose height is the sum of the height of the left-hand-side operand and the Offset.dy dimension of the right-hand-side operand.
-
operator -(
OffsetBase other) → dynamic -
Binary subtraction operator for Size.
-
operator /(
double operand) → Size -
Division operator. Returns a size whose dimensions are the dimensions of the left-hand-side operand (a Size) divided by the scalar right-hand-side operand (a double).
-
operator ==(
other) → bool -
Compares two Sizes for equality.
-
operator ~/(
double operand) → Size -
Integer (truncating) division operator. Returns a size whose dimensions are the dimensions of the left-hand-side operand (a Size) divided by the scalar right-hand-side operand (a double), rounded towards zero.
-
operator <(
OffsetBase other) → bool -
Less-than operator. Compares an Offset or Size to another Offset or Size, and returns true if both the horizontal and vertical values of the left-hand-side operand are smaller than the horizontal and vertical values of the right-hand-side operand respectively. Returns false otherwise.
inherited -
operator <=(
OffsetBase other) → bool -
Less-than-or-equal-to operator. Compares an Offset or Size to another Offset or Size, and returns true if both the horizontal and vertical values of the left-hand-side operand are smaller than or equal to the horizontal and vertical values of the right-hand-side operand respectively. Returns false otherwise.
inherited -
operator >(
OffsetBase other) → bool -
Greater-than operator. Compares an Offset or Size to another Offset or Size, and returns true if both the horizontal and vertical values of the left-hand-side operand are bigger than the horizontal and vertical values of the right-hand-side operand respectively. Returns false otherwise.
inherited -
operator >=(
OffsetBase other) → bool -
Greater-than-or-equal-to operator. Compares an Offset or Size to another Offset or Size, and returns true if both the horizontal and vertical values of the left-hand-side operand are bigger than or equal to the horizontal and vertical values of the right-hand-side operand respectively. Returns false otherwise.
inherited
Methods
-
bottomCenter(
Point origin) → Point -
The point at the center of the bottom edge of the rectangle described by the given point (which is interpreted as the top-left corner) and this size.
-
bottomLeft(
Point origin) → Point -
The point at the intersection of the bottom and left edges of the rectangle described by the given point (which is interpreted as the top-left corner) and this size.
-
bottomRight(
Point origin) → Point -
The point at the intersection of the bottom and right edges of the rectangle described by the given point (which is interpreted as the top-left corner) and this size.
-
center(
Point origin) → Point -
The point halfway between the left and right and the top and bottom edges of the rectangle described by the given point (which is interpreted as the top-left corner) and this size.
-
centerLeft(
Point origin) → Point -
The point at the center of the left edge of the rectangle described by the given point (which is interpreted as the top-left corner) and this size.
-
centerRight(
Point origin) → Point -
The point at the center of the right edge of the rectangle described by the given point (which is interpreted as the top-left corner) and this size.
-
topCenter(
Point origin) → Point -
The point at the center of the top edge of the rectangle described by the given point (which is interpreted as the top-left corner) and this size.
-
topLeft(
Point origin) → Point -
The point at the intersection of the top and left edges of the rectangle described by the given point (which is interpreted as the top-left corner) and this size.
-
topRight(
Point origin) → Point -
The point at the intersection of the top and right edges of the rectangle described by the given point (which is interpreted as the top-left corner) and this size.
-
toString(
) → String -
Returns a string representation of this object.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited