Skip to main content

AssetImage

Struct AssetImage 

Source
pub struct AssetImage {
    pub name: String,
    pub scale: f64,
}
Expand description

Decodes an image the application bundles. Flutter ExactAssetImage.

Dart’s AssetImage also picks among the resolution variants a manifest declares — the two- and three-times copies of the same picture. Without a manifest this names one asset exactly, which is Dart’s ExactAssetImage; see PORTING.md.

Fields§

§name: String

The asset’s name in the bundle.

§scale: f64

Linear pixels per logical point in the decoded image.

Implementations§

Source§

impl AssetImage

Source

pub fn new(name: impl Into<String>) -> AssetImage

Creates a provider for a bundled asset at the natural scale.

Source

pub fn scale(self, scale: f64) -> AssetImage

Dart ExactAssetImage(scale:).

Trait Implementations§

Source§

impl Clone for AssetImage

Source§

fn clone(&self) -> AssetImage

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 Debug for AssetImage

Source§

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

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

impl ImageProvider for AssetImage

Source§

fn key(&self, configuration: &ImageConfiguration) -> ImageCacheKey

What names this image in the cache. Flutter obtainKey. Read more
Source§

fn load_image( &self, app: &mut App, key: &ImageCacheKey, ) -> Retained<Handle<ImageStreamCompleter>>

Starts decoding, answering with the completer that will carry the frame. Flutter loadImage. Read more
Source§

fn resolve( &self, app: &mut App, configuration: &ImageConfiguration, ) -> Retained<Handle<ImageStream>>

The stream for this image, sharing whatever the cache already has. Flutter resolve.

Auto Trait Implementations§

§

impl Forget for AssetImage

§

impl Freeze for AssetImage
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze,

§

impl Move for AssetImage

§

impl RefUnwindSafe for AssetImage

§

impl Send for AssetImage
where RawVecInner: Send,

§

impl Sync for AssetImage
where RawVecInner: Sync,

§

impl Unpin for AssetImage
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for AssetImage

§

impl UnwindSafe for AssetImage
where RawVecInner: UnwindSafe,

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, 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,