LottieBuilderExt

Trait LottieBuilderExt 

Source
pub trait LottieBuilderExt {
Show 18 methods // Required 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§

Source

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

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

Source

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

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

Source

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

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

Source

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

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

Source

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

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.

Source

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

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.

Source

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

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.

Source

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

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.

Source

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

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.
Source

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

Some options to enable/disable some feature of Lottie

  • enableMergePaths: Enable merge path support
Source

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

Source

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

Source

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

Source

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

Source

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

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.

Source

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

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.

Source

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

Source

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

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§