LottieBuilder.file constructor
LottieBuilder.file(
- Object file, {
- Animation<
double> ? controller, - FrameRate? frameRate,
- bool? animate,
- bool? reverse,
- bool? repeat,
- LottieDelegates? delegates,
- LottieOptions? options,
- LottieImageProviderFactory? imageProviderFactory,
- void onLoaded()?,
- Key? key,
- LottieFrameBuilder? frameBuilder,
- ImageErrorWidgetBuilder? errorBuilder,
- double? width,
- double? height,
- BoxFit? fit,
- AlignmentGeometry? alignment,
- bool? addRepaintBoundary,
- FilterQuality? filterQuality,
- WarningCallback? onWarning,
Creates a widget that displays an LottieComposition obtained from a File.
Either the width and height arguments should be specified, or the widget should be placed in a context that sets tight layout constraints. Otherwise, the image dimensions will change as the animation is loaded, which will result in ugly layout changes.
On Android, this may require the
android.permission.READ_EXTERNAL_STORAGE
permission.
Implementation
LottieBuilder.file(
Object /*io.File|html.File*/ file, {
this.controller,
this.frameRate,
this.animate,
this.reverse,
this.repeat,
this.delegates,
this.options,
LottieImageProviderFactory? imageProviderFactory,
this.onLoaded,
Key? key,
this.frameBuilder,
this.errorBuilder,
this.width,
this.height,
this.fit,
this.alignment,
this.addRepaintBoundary,
this.filterQuality,
this.onWarning,
}) : lottie = FileLottie(file, imageProviderFactory: imageProviderFactory),
super(key: key);