Skip to main content

EdgeInsetsGeometry

Enum EdgeInsetsGeometry 

Source
#[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:

Non-exhaustive: Flutter may add a subclass.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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.

Fields

§left: f64

The offset from the left.

§right: f64

The offset from the right.

§start: f64

The offset from the start side.

§end: f64

The offset from the end side.

§top: f64

The offset from the top.

§bottom: f64

The offset from the bottom.

Implementations§

Source§

impl EdgeInsetsGeometry

Source

pub const ZERO: EdgeInsetsGeometry

An EdgeInsets with zero offsets in each direction.

Source

pub const INFINITY: EdgeInsetsGeometry

An EdgeInsetsGeometry with infinite offsets in each direction.

Can be used as an infinite upper bound for clamp.

Source

pub const fn all(value: f64) -> EdgeInsetsGeometry

Creates insets where all the offsets are value.

Source

pub const fn only( left: f64, top: f64, right: f64, bottom: f64, ) -> EdgeInsetsGeometry

Creates EdgeInsets with only the given values non-zero.

Source

pub const fn directional( start: f64, top: f64, end: f64, bottom: f64, ) -> EdgeInsetsGeometry

Creates EdgeInsetsDirectional with only the given values non-zero.

Source

pub const fn symmetric(vertical: f64, horizontal: f64) -> EdgeInsetsGeometry

Creates EdgeInsets with symmetrical vertical and horizontal offsets.

Source

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.

Source

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.

Source

pub fn is_non_negative(&self) -> bool

Whether every dimension is non-negative.

Source

pub fn horizontal(&self) -> f64

The total offset in the horizontal direction.

Source

pub fn vertical(&self) -> f64

The total offset in the vertical direction.

Source

pub fn along(&self, axis: Axis) -> f64

The total offset in the given direction.

Source

pub fn collapsed_size(&self) -> Size

The size that this EdgeInsets would occupy with an empty interior.

Source

pub fn flipped(&self) -> EdgeInsetsGeometry

An EdgeInsetsGeometry with top and bottom, left and right, and start and end flipped.

Source

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:

Source

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:

Source

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.

Source

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.

Source

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.

Source

pub fn truncating_div(&self, other: f64) -> EdgeInsetsGeometry

Integer divides the EdgeInsetsGeometry object in each dimension by the given factor.

Source

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.

Source

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:

Trait Implementations§

Source§

impl Animatable<EdgeInsetsGeometry> for EdgeInsetsGeometryTween

Source§

fn transform(&self, _app: &App, t: f64) -> EdgeInsetsGeometry

Returns the value of the object at point t. Read more
Source§

fn evaluate(&self, app: &App, animation: AnyAnimation<f64>) -> T
where Self: Sized,

The current value of this object for the given animation. Read more
Source§

fn animate( self, app: &mut App, parent: Retained<AnyAnimation<f64>>, ) -> Retained<AnyAnimation<T>>
where Self: Sized + Clone + 'static, T: 'static,

Returns a new animation that is driven by the given animation but that takes on values determined by this object. The new animation keeps parent; whoever keeps the result keeps both.
Source§

fn chain<P>(self, parent: P) -> ChainedEvaluation<P, Self>
where Self: Sized + Clone, P: Animatable<f64> + Clone,

Returns a new Animatable whose value is determined by first evaluating the given parent and then evaluating this object at the result.
Source§

impl Clone for EdgeInsetsGeometry

Source§

fn clone(&self) -> EdgeInsetsGeometry

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for EdgeInsetsGeometry

Source§

impl Debug for EdgeInsetsGeometry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Display for EdgeInsetsGeometry

Dart’s EdgeInsetsGeometry.toString, the same text as Debug.

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

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

The resulting type after applying the / operator.
Source§

fn div(self, other: f64) -> EdgeInsetsGeometry

Performs the / operation. Read more
Source§

impl From<EdgeInsets> for EdgeInsetsGeometry

Source§

fn from(insets: EdgeInsets) -> EdgeInsetsGeometry

Converts to this type from the input type.
Source§

impl From<EdgeInsetsDirectional> for EdgeInsetsGeometry

Source§

fn from(insets: EdgeInsetsDirectional) -> EdgeInsetsGeometry

Converts to this type from the input type.
Source§

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

The resulting type after applying the * operator.
Source§

fn mul(self, other: f64) -> EdgeInsetsGeometry

Performs the * operation. Read more
Source§

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

The resulting type after applying the - operator.
Source§

fn neg(self) -> EdgeInsetsGeometry

Performs the unary - operation. Read more
Source§

impl PartialEq for EdgeInsetsGeometry

Source§

fn eq(&self, other: &EdgeInsetsGeometry) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

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

The resulting type after applying the % operator.
Source§

fn rem(self, other: f64) -> EdgeInsetsGeometry

Performs the % operation. Read more
Source§

impl TweenValue for EdgeInsetsGeometry

Source§

fn same(&self, other: &EdgeInsetsGeometry) -> bool

Dart’s == between a widget’s target value and a tween endpoint.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,