#[non_exhaustive]pub enum EdgeInsetsGeometry {
Insets(EdgeInsets),
Directional(EdgeInsetsDirectional),
Mixed {
left: f64,
right: f64,
start: f64,
end: f64,
top: f64,
bottom: f64,
},
}Expand description
Base class for EdgeInsets that allows for text-direction aware
resolution.
A property or argument of this type accepts classes created either with
EdgeInsets::from_ltrb and its variants, or
EdgeInsetsDirectional::from_steb and its variants.
To convert an EdgeInsetsGeometry object of indeterminate type into an
EdgeInsets object, call the resolve
method.
See also:
Padding, a widget that describes margins usingEdgeInsetsGeometry.
Non-exhaustive: Flutter may add a subclass.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Insets(EdgeInsets)
Insets with fixed visual sides — Dart’s EdgeInsets.
Directional(EdgeInsetsDirectional)
Insets relative to the writing direction — Dart’s EdgeInsetsDirectional.
Mixed
Visual and directional offsets at once — Dart’s private _MixedEdgeInsets,
what combining the two kinds produces.
Implementations§
Source§impl EdgeInsetsGeometry
impl EdgeInsetsGeometry
Sourcepub const ZERO: EdgeInsetsGeometry
pub const ZERO: EdgeInsetsGeometry
An EdgeInsets with zero offsets in each direction.
Sourcepub const INFINITY: EdgeInsetsGeometry
pub const INFINITY: EdgeInsetsGeometry
An EdgeInsetsGeometry with infinite offsets in each direction.
Can be used as an infinite upper bound for clamp.
Sourcepub const fn all(value: f64) -> EdgeInsetsGeometry
pub const fn all(value: f64) -> EdgeInsetsGeometry
Creates insets where all the offsets are value.
Sourcepub const fn only(
left: f64,
top: f64,
right: f64,
bottom: f64,
) -> EdgeInsetsGeometry
pub const fn only( left: f64, top: f64, right: f64, bottom: f64, ) -> EdgeInsetsGeometry
Creates EdgeInsets with only the given values non-zero.
Sourcepub const fn directional(
start: f64,
top: f64,
end: f64,
bottom: f64,
) -> EdgeInsetsGeometry
pub const fn directional( start: f64, top: f64, end: f64, bottom: f64, ) -> EdgeInsetsGeometry
Creates EdgeInsetsDirectional with only the given values non-zero.
Sourcepub const fn symmetric(vertical: f64, horizontal: f64) -> EdgeInsetsGeometry
pub const fn symmetric(vertical: f64, horizontal: f64) -> EdgeInsetsGeometry
Creates EdgeInsets with symmetrical vertical and horizontal offsets.
Sourcepub const fn from_ltrb(
left: f64,
top: f64,
right: f64,
bottom: f64,
) -> EdgeInsetsGeometry
pub const fn from_ltrb( left: f64, top: f64, right: f64, bottom: f64, ) -> EdgeInsetsGeometry
Creates EdgeInsets from offsets from the left, top, right, and
bottom.
Sourcepub const fn from_steb(
start: f64,
top: f64,
end: f64,
bottom: f64,
) -> EdgeInsetsGeometry
pub const fn from_steb( start: f64, top: f64, end: f64, bottom: f64, ) -> EdgeInsetsGeometry
Creates EdgeInsetsDirectional from offsets from the start, top, end,
and bottom.
Sourcepub fn is_non_negative(&self) -> bool
pub fn is_non_negative(&self) -> bool
Whether every dimension is non-negative.
Sourcepub fn horizontal(&self) -> f64
pub fn horizontal(&self) -> f64
The total offset in the horizontal direction.
Sourcepub fn collapsed_size(&self) -> Size
pub fn collapsed_size(&self) -> Size
The size that this EdgeInsets would occupy with an empty interior.
Sourcepub fn flipped(&self) -> EdgeInsetsGeometry
pub fn flipped(&self) -> EdgeInsetsGeometry
An EdgeInsetsGeometry with top and bottom, left and right, and start
and end flipped.
Sourcepub fn inflate_size(&self, size: Size) -> Size
pub fn inflate_size(&self, 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.
See also:
EdgeInsets::inflate_rect, to inflate aRectrather than aSize(forEdgeInsetsDirectional, requires first callingresolveto establish how the start and end map to the left or right).deflate_size, to deflate aSizerather than inflating it.
Sourcepub fn deflate_size(&self, size: Size) -> Size
pub fn deflate_size(&self, 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.
If the argument is smaller than collapsed_size,
then the resulting size will have negative dimensions.
See also:
EdgeInsets::deflate_rect, to deflate aRectrather than aSize. (forEdgeInsetsDirectional, requires first callingresolveto establish how the start and end map to the left or right).inflate_size, to inflate aSizerather than deflating it.
Sourcepub fn subtract(self, other: EdgeInsetsGeometry) -> EdgeInsetsGeometry
pub fn subtract(self, other: EdgeInsetsGeometry) -> EdgeInsetsGeometry
Returns the difference between two EdgeInsetsGeometry objects.
If you know you are applying this to two EdgeInsets or two
EdgeInsetsDirectional objects, consider using the binary infix -
operator instead, which always returns an object of the same type as the
operands, and is typed accordingly.
Applied to two objects of the same kind, the result is of that kind;
otherwise it is the mixed arm, which resolve turns
into a concrete EdgeInsets.
This method returns the same result as add applied to the
negation of the argument.
Sourcepub fn add(self, other: EdgeInsetsGeometry) -> EdgeInsetsGeometry
pub fn add(self, other: EdgeInsetsGeometry) -> EdgeInsetsGeometry
Returns the sum of two EdgeInsetsGeometry objects.
If you know you are adding two EdgeInsets or two
EdgeInsetsDirectional objects, consider using the + operator
instead, which always returns an object of the same type as the operands,
and is typed accordingly.
Applied to two objects of the same kind, the result is of that kind;
otherwise it is the mixed arm, which resolve turns
into a concrete EdgeInsets.
Sourcepub fn clamp(
&self,
min: &EdgeInsetsGeometry,
max: &EdgeInsetsGeometry,
) -> EdgeInsetsGeometry
pub fn clamp( &self, min: &EdgeInsetsGeometry, max: &EdgeInsetsGeometry, ) -> EdgeInsetsGeometry
Returns a new EdgeInsetsGeometry object with all values greater than
or equal to min, and less than or equal to max.
Sourcepub fn truncating_div(&self, other: f64) -> EdgeInsetsGeometry
pub fn truncating_div(&self, other: f64) -> EdgeInsetsGeometry
Integer divides the EdgeInsetsGeometry object in each dimension by
the given factor.
Sourcepub fn lerp(
a: Option<EdgeInsetsGeometry>,
b: Option<EdgeInsetsGeometry>,
t: f64,
) -> Option<EdgeInsetsGeometry>
pub fn lerp( a: Option<EdgeInsetsGeometry>, b: Option<EdgeInsetsGeometry>, t: f64, ) -> Option<EdgeInsetsGeometry>
Linearly interpolate between two EdgeInsetsGeometry objects.
If either is None, this function interpolates from
EdgeInsets::ZERO, and the result is of the same kind as the non-None
argument.
Applied to two objects of the same kind, the result is of that kind;
otherwise it is the mixed arm, which resolve turns
into a concrete EdgeInsets.
Sourcepub fn resolve(&self, direction: Option<TextDirection>) -> EdgeInsets
pub fn resolve(&self, direction: Option<TextDirection>) -> EdgeInsets
Convert this instance into an EdgeInsets, which uses literal
coordinates (i.e. the left coordinate being explicitly a distance from
the left, and the right coordinate being explicitly a distance from
the right).
See also:
EdgeInsets, for which this is a no-op (returns itself).EdgeInsetsDirectional, which flips the horizontal direction based on thedirectionargument.
Trait Implementations§
Source§impl Animatable<EdgeInsetsGeometry> for EdgeInsetsGeometryTween
impl Animatable<EdgeInsetsGeometry> for EdgeInsetsGeometryTween
Source§fn transform(&self, _app: &App, t: f64) -> EdgeInsetsGeometry
fn transform(&self, _app: &App, t: f64) -> EdgeInsetsGeometry
t. Read moreSource§fn evaluate(&self, app: &App, animation: AnyAnimation<f64>) -> Twhere
Self: Sized,
fn evaluate(&self, app: &App, animation: AnyAnimation<f64>) -> Twhere
Self: Sized,
Source§fn animate(
self,
app: &mut App,
parent: Retained<AnyAnimation<f64>>,
) -> Retained<AnyAnimation<T>>
fn animate( self, app: &mut App, parent: Retained<AnyAnimation<f64>>, ) -> Retained<AnyAnimation<T>>
parent; whoever keeps the result keeps both.Source§fn chain<P>(self, parent: P) -> ChainedEvaluation<P, Self>
fn chain<P>(self, parent: P) -> ChainedEvaluation<P, Self>
Animatable whose value is determined by first
evaluating the given parent and then evaluating this object at the
result.Source§impl Clone for EdgeInsetsGeometry
impl Clone for EdgeInsetsGeometry
Source§fn clone(&self) -> EdgeInsetsGeometry
fn clone(&self) -> EdgeInsetsGeometry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for EdgeInsetsGeometry
Source§impl Debug for EdgeInsetsGeometry
impl Debug for EdgeInsetsGeometry
Source§impl Display for EdgeInsetsGeometry
Dart’s EdgeInsetsGeometry.toString, the same text as Debug.
impl Display for EdgeInsetsGeometry
Dart’s EdgeInsetsGeometry.toString, the same text as Debug.
Source§impl Div<f64> for EdgeInsetsGeometry
Divides the EdgeInsetsGeometry object in each dimension by the given
factor.
impl Div<f64> for EdgeInsetsGeometry
Divides the EdgeInsetsGeometry object in each dimension by the given
factor.
This operator returns an object of the same type as the operand.
Source§type Output = EdgeInsetsGeometry
type Output = EdgeInsetsGeometry
/ operator.Source§impl From<EdgeInsets> for EdgeInsetsGeometry
impl From<EdgeInsets> for EdgeInsetsGeometry
Source§fn from(insets: EdgeInsets) -> EdgeInsetsGeometry
fn from(insets: EdgeInsets) -> EdgeInsetsGeometry
Source§impl From<EdgeInsetsDirectional> for EdgeInsetsGeometry
impl From<EdgeInsetsDirectional> for EdgeInsetsGeometry
Source§fn from(insets: EdgeInsetsDirectional) -> EdgeInsetsGeometry
fn from(insets: EdgeInsetsDirectional) -> EdgeInsetsGeometry
Source§impl Mul<f64> for EdgeInsetsGeometry
Scales the EdgeInsetsGeometry object in each dimension by the given
factor.
impl Mul<f64> for EdgeInsetsGeometry
Scales the EdgeInsetsGeometry object in each dimension by the given
factor.
This operator returns an object of the same type as the operand.
Source§type Output = EdgeInsetsGeometry
type Output = EdgeInsetsGeometry
* operator.Source§impl Neg for EdgeInsetsGeometry
Returns the EdgeInsetsGeometry object with each dimension negated.
impl Neg for EdgeInsetsGeometry
Returns the EdgeInsetsGeometry object with each dimension negated.
This is the same as multiplying the object by -1.0.
This operator returns an object of the same type as the operand.
Source§type Output = EdgeInsetsGeometry
type Output = EdgeInsetsGeometry
- operator.Source§fn neg(self) -> EdgeInsetsGeometry
fn neg(self) -> EdgeInsetsGeometry
- operation. Read moreSource§impl PartialEq for EdgeInsetsGeometry
impl PartialEq for EdgeInsetsGeometry
Source§impl Rem<f64> for EdgeInsetsGeometry
Computes the remainder in each dimension by the given factor.
impl Rem<f64> for EdgeInsetsGeometry
Computes the remainder in each dimension by the given factor.
This operator returns an object of the same type as the operand.
Source§type Output = EdgeInsetsGeometry
type Output = EdgeInsetsGeometry
% operator.Source§impl TweenValue for EdgeInsetsGeometry
impl TweenValue for EdgeInsetsGeometry
Source§fn same(&self, other: &EdgeInsetsGeometry) -> bool
fn same(&self, other: &EdgeInsetsGeometry) -> bool
== between a widget’s target value and a tween endpoint.