An immutable set of offsets in each of the four cardinal directions.
Typically used for an offset from each of the four sides of a box. For example, the padding inside a box can be represented using this class.
Constants
- zero → EdgeInsets
-
An EdgeInsets with zero offsets in each direction.
const EdgeInsets.all(0.0)
Static Methods
-
lerp(
EdgeInsets a, EdgeInsets b, double t) → EdgeInsets -
Linearly interpolate between two EdgeInsets.
Constructors
- EdgeInsets.all(double value)
-
Creates insets where all the offsets are value.
const - EdgeInsets.fromLTRB(double left, double top, double right, double bottom)
-
Creates insets from offsets from the left, top, right, and bottom.
const - EdgeInsets.fromWindowPadding(WindowPadding padding, double devicePixelRatio)
-
Creates insets that match the given window padding.
- EdgeInsets.only({double left: 0.0, double top: 0.0, double right: 0.0, double bottom: 0.0 })
-
Creates insets with only the given values non-zero.
const - EdgeInsets.symmetric({double vertical: 0.0, double horizontal: 0.0 })
-
Creates insets with symmetrical vertical and horizontal offsets.
const
Properties
- bottom → double
-
The offset from the bottom.
read-only - bottomLeft → Offset
-
An Offset describing the vector from the bottom left of a rectangle to the bottom left of that rectangle inset by this object.
read-only - bottomRight → Offset
-
An Offset describing the vector from the bottom right of a rectangle to the bottom right of that rectangle inset by this object.
read-only - collapsedSize → Size
-
The size that this EdgeInsets would occupy with an empty interior.
read-only - flipped → EdgeInsets
-
An EdgeInsets with top and bottom as well as left and right flipped.
read-only - hashCode → int
-
read-only
- horizontal → double
-
The total offset in the vertical direction.
read-only - isNonNegative → bool
-
Whether every dimension is non-negative.
read-only - left → double
-
The offset from the left.
read-only - right → double
-
The offset from the right.
read-only - top → double
-
The offset from the top.
read-only - topLeft → Offset
-
An Offset describing the vector from the top left of a rectangle to the top left of that rectangle inset by this object.
read-only - topRight → Offset
-
An Offset describing the vector from the top right of a rectangle to the top right of that rectangle inset by this object.
read-only - vertical → double
-
The total offset in the horizontal direction.
read-only - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Operators
-
operator %(
double other) → EdgeInsets -
Computes the remainder in each dimension by the given factor.
-
operator *(
double other) → EdgeInsets -
Scales the EdgeInsets in each dimension by the given factor.
-
operator +(
EdgeInsets other) → EdgeInsets -
Returns the sum of two EdgeInsets.
-
operator -(
EdgeInsets other) → EdgeInsets -
Returns the difference between two EdgeInsets.
-
operator /(
double other) → EdgeInsets -
Divides the EdgeInsets in each dimension by the given factor.
-
operator ==(
other) → bool -
The equality operator.
-
operator ~/(
double other) → EdgeInsets -
Integer divides the EdgeInsets in each dimension by the given factor.
Methods
-
along(
Axis axis) → double -
The total offset in the given direction.
-
deflateRect(
Rect rect) → Rect -
Returns a new rect that is smaller than the given rect in each direction by the amount of inset in each direction. Specifically, the left edge of the rect is moved right by left, the top edge of the rect is moved down by top, the right edge of the rect is moved left by right, and the bottom edge of the rect is moved up by bottom.
-
deflateSize(
Size size) → Size -
Returns a new size that is smaller than the given size by the amount of inset in the horizontal and vertical directions.
-
inflateRect(
Rect rect) → Rect -
Returns a new rect that is bigger than the given rect in each direction by the amount of inset in each direction. Specifically, the left edge of the rect is moved left by left, the top edge of the rect is moved up by top, the right edge of the rect is moved right by right, and the bottom edge of the rect is moved down by bottom.
-
inflateSize(
Size size) → Size -
Returns a new size that is bigger than the given size by the amount of inset in the horizontal and vertical directions.
-
toString(
) → String -
Returns a string representation of this object.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited