Trait animate::lottie::LottieBuilderExt[][src]

pub trait LottieBuilderExt {
Show methods fn asset(&self, name: &str) -> &Self;
fn file(&self, file: File) -> &Self;
fn memory(&self, byf: Bytes) -> &Self;
fn network(&self, url: &str) -> &Self;
fn framerate(&self, framerate: FrameRate) -> &Self;
fn animate(&self, animate: bool) -> &Self;
fn repeat(&self, repeat: bool) -> &Self;
fn reverse(&self, reverse: bool) -> &Self;
fn delegates(&self, delegates: LottieDelegates) -> &Self;
fn options(&self, options: LottieDelegates) -> &Self;
fn onloaded(&self, f: &str) -> &Self;
fn image_provider_factory(
        &self,
        factory: LottieImageProviderFactory
    ) -> &Self;
fn key(&self, key: &str) -> &Self;
fn framebuilder(&self, bundle: LottieFrameBuilder) -> &Self;
fn width(&self, width: f64) -> &Self;
fn height(&self, height: f64) -> &Self;
fn package(&self, package: &str) -> &Self;
fn add_repaint_boundary(&self, value: bool) -> &Self;
}

Required methods

fn asset(&self, name: &str) -> &Self[src]

Creates a widget that displays an LottieComposition obtained from an AssetBundle.

fn file(&self, file: File) -> &Self[src]

Creates a widget that displays an LottieComposition obtained from a File.

fn memory(&self, byf: Bytes) -> &Self[src]

Creates a widget that displays an LottieComposition obtained from a Uint8List.

fn network(&self, url: &str) -> &Self[src]

Creates a widget that displays an LottieComposition obtained from the network.

fn framerate(&self, framerate: FrameRate) -> &Self[src]

The number of frames per second to render. Use FrameRate.composition to use the original frame rate of the Lottie composition (default) Use FrameRate.max to advance the animation progression at every frame.

The advantage of using a low frame rate is to preserve the device battery by doing less rendering work.

fn animate(&self, animate: bool) -> &Self[src]

If no controller is specified, this value indicate whether or not the Lottie animation should be played automatically (default to true). If there is an animation controller specified, this property has no effect.

See [repeat] to control whether the animation should repeat.

fn repeat(&self, repeat: bool) -> &Self[src]

Specify that the automatic animation should repeat in a loop (default to true). The property has no effect if animate is false or controller is not null.

fn reverse(&self, reverse: bool) -> &Self[src]

Specify that the automatic animation should repeat in a loop in a “reverse” mode (go from start to end and then continuously from end to start). It default to false. The property has no effect if animate is false, repeat is false or controller is not null.

fn delegates(&self, delegates: LottieDelegates) -> &Self[src]

A group of callbacks to further customize the lottie animation.

  • A text delegate to dynamically change some text displayed in the animation
  • A value callback to change the properties of the animation at runtime.
  • A text style factory to map between a font family specified in the animation and the font family in your assets.

fn options(&self, options: LottieDelegates) -> &Self[src]

Some options to enable/disable some feature of Lottie

  • enableMergePaths: Enable merge path support

fn onloaded(&self, f: &str) -> &Self[src]

fn image_provider_factory(&self, factory: LottieImageProviderFactory) -> &Self[src]

fn key(&self, key: &str) -> &Self[src]

fn framebuilder(&self, bundle: LottieFrameBuilder) -> &Self[src]

fn width(&self, width: f64) -> &Self[src]

If non-null, requires the composition to have this width.

If null, the composition will pick a size that best preserves its intrinsic aspect ratio.

fn height(&self, height: f64) -> &Self[src]

If non-null, require the composition to have this height.

If null, the composition will pick a size that best preserves its intrinsic aspect ratio.

fn package(&self, package: &str) -> &Self[src]

fn add_repaint_boundary(&self, value: bool) -> &Self[src]

Indicate to automatically add a RepaintBoundary widget around the animation. This allows to optimize the app performance by isolating the animation in its own Layer.

This property is true by default.

Loading content...

Implementors

impl LottieBuilderExt for Builder<Lottie>[src]

fn asset(&self, name: &str) -> &Self[src]

Creates a widget that displays an LottieComposition obtained from an AssetBundle.

fn file(&self, file: File) -> &Self[src]

Creates a widget that displays an LottieComposition obtained from a File.

fn memory(&self, byf: Bytes) -> &Self[src]

Creates a widget that displays an LottieComposition obtained from a Uint8List.

fn network(&self, url: &str) -> &Self[src]

Creates a widget that displays an LottieComposition obtained from the network.

Loading content...