EdgeInsetsGeometry class abstract
Base class for EdgeInsets that allows for text-direction aware resolution.
A property or argument of this type accepts classes created either with EdgeInsets.fromLTRB and its variants, or EdgeInsetsDirectional.fromSTEB and its variants.
To convert an EdgeInsetsGeometry object of indeterminate type into a EdgeInsets object, call the resolve method.
See also:
- Padding, a widget that describes margins using EdgeInsetsGeometry.
- Implementers
- Annotations
Constructors
- EdgeInsetsGeometry()
-
Abstract const constructor. This constructor enables subclasses to provide
const constructors so that they can be used in const expressions.
const
- EdgeInsetsGeometry.all(double value)
-
Creates insets where all the offsets are
value
.constfactory - EdgeInsetsGeometry.directional({double start, double end, double top, double bottom})
-
Creates EdgeInsetsDirectional with only the given values non-zero.
constfactory
- EdgeInsetsGeometry.fromLTRB(double left, double top, double right, double bottom)
-
Creates EdgeInsets from offsets from the left, top, right, and bottom.
constfactory
- EdgeInsetsGeometry.fromSTEB(double start, double top, double end, double bottom)
-
Creates EdgeInsetsDirectional from offsets from the start, top, end, and
bottom.
constfactory
- EdgeInsetsGeometry.fromViewPadding(ViewPadding padding, double devicePixelRatio)
-
Creates EdgeInsets that match the given view padding.
factory
- EdgeInsetsGeometry.only({double left, double right, double top, double bottom})
-
Creates EdgeInsets with only the given values non-zero.
constfactory
- EdgeInsetsGeometry.symmetric({double vertical, double horizontal})
-
Creates EdgeInsets with symmetrical vertical and horizontal offsets.
constfactory
Properties
- collapsedSize → Size
-
The size that this EdgeInsets would occupy with an empty interior.
no setter
- flipped → EdgeInsetsGeometry
-
An EdgeInsetsGeometry with top and bottom, left and right, and start and end flipped.
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- horizontal → double
-
The total offset in the horizontal direction.
no setter
- isNonNegative → bool
-
Whether every dimension is non-negative.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- vertical → double
-
The total offset in the vertical direction.
no setter
Methods
-
add(
EdgeInsetsGeometry other) → EdgeInsetsGeometry - Returns the sum of two EdgeInsetsGeometry objects.
-
along(
Axis axis) → double - The total offset in the given direction.
-
clamp(
EdgeInsetsGeometry min, EdgeInsetsGeometry max) → EdgeInsetsGeometry -
Returns a new EdgeInsetsGeometry object with all values greater than
or equal to
min
, and less than or equal tomax
. -
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.
-
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.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolve(
TextDirection? direction) → EdgeInsets -
Convert this instance into an EdgeInsets, which uses literal coordinates
(i.e. the
left
coordinate being explicitly a distance from the left, and theright
coordinate being explicitly a distance from the right). -
subtract(
EdgeInsetsGeometry other) → EdgeInsetsGeometry - Returns the difference between two EdgeInsetsGeometry objects.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator %(
double other) → EdgeInsetsGeometry - Computes the remainder in each dimension by the given factor.
-
operator *(
double other) → EdgeInsetsGeometry - Scales the EdgeInsetsGeometry object in each dimension by the given factor.
-
operator /(
double other) → EdgeInsetsGeometry - Divides the EdgeInsetsGeometry object in each dimension by the given factor.
-
operator ==(
Object other) → bool -
The equality operator.
override
-
operator unary-(
) → EdgeInsetsGeometry - Returns the EdgeInsetsGeometry object with each dimension negated.
-
operator ~/(
double other) → EdgeInsetsGeometry - Integer divides the EdgeInsetsGeometry object in each dimension by the given factor.
Static Methods
-
lerp(
EdgeInsetsGeometry? a, EdgeInsetsGeometry? b, double t) → EdgeInsetsGeometry? - Linearly interpolate between two EdgeInsetsGeometry objects.
Constants
- infinity → const EdgeInsetsGeometry
- An EdgeInsetsGeometry with infinite offsets in each direction.
- zero → const EdgeInsetsGeometry
- An EdgeInsets with zero offsets in each direction.