EdgeInsets class final

Flutter's EdgeInsets, or EdgeInsetsDirectional when directional.

JSON: a number (every side), [horizontal, vertical] ([14, 12]: 14 left and right, 12 top and bottom), [left, top, right, bottom], or a map. A map with start or end is directional (Flutter's EdgeInsetsDirectional): {"start": 16, "top": 8, "end": 4, "bottom": 8} puts 16 on the left under a left-to-right textDirection and on the right under right-to-left. A map with only left/top/right/bottom is the absolute form.

A directional value keeps its start in left and its end in right; resolve gives the absolute insets for a direction.

Annotations
  • @immutable

Constructors

EdgeInsets.all(double v)
const
EdgeInsets.fromLTRB(double left, double top, double right, double bottom)
const
EdgeInsets.fromSTEB(double start, double top, double end, double bottom)
Flutter's EdgeInsetsDirectional.fromSTEB: start and end follow the text direction.
const
EdgeInsets.only({double left = 0, double top = 0, double right = 0, double bottom = 0})
const
EdgeInsets.symmetric({double horizontal = 0, double vertical = 0})
const

Properties

bottom → double
For a directional value, left is the start and right the end.
final
directional → bool
Whether left and right are the start and end sides, which swap under a right-to-left text direction.
final
end → double
The end side (right of a directional value).
no setter
hashCode → int
The hash code for this object.
no setteroverride
horizontal → double
no setter
isZero → bool
no setter
left → double
For a directional value, left is the start and right the end.
final
For a directional value, left is the start and right the end.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
start → double
The start side (left of a directional value).
no setter
top → double
For a directional value, left is the start and right the end.
final
vertical → double
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolve({required bool rtl}) → EdgeInsets
The absolute insets under a right-to-left (rtl) or left-to-right text direction: a directional value's start goes on the right under right-to-left. An absolute value is itself.
toJson() → Object
toString() → String
A string representation of this object.
override

Operators

operator +(EdgeInsets o) → EdgeInsets
The sum, side by side. Directional only when both are.
operator ==(Object other) → bool
The equality operator.
override

Static Methods

fromJson(Object? json) → EdgeInsets

Constants

zero → const EdgeInsets