LottieBuilder.file constructor

LottieBuilder.file(
  1. File file, {
  2. Animation<double>? controller,
  3. FrameRate? frameRate,
  4. bool? animate,
  5. bool? reverse,
  6. bool? repeat,
  7. LottieDelegates? delegates,
  8. LottieOptions? options,
  9. LottieImageProviderFactory? imageProviderFactory,
  10. void onLoaded(
    1. LottieComposition
    )?,
  11. Key? key,
  12. LottieFrameBuilder? frameBuilder,
  13. ImageErrorWidgetBuilder? errorBuilder,
  14. double? width,
  15. double? height,
  16. BoxFit? fit,
  17. AlignmentGeometry? alignment,
  18. bool? addRepaintBoundary,
  19. FilterQuality? filterQuality,
  20. WarningCallback? onWarning,
  21. LottieDecoder? decoder,
  22. RenderCache? renderCache,
  23. bool? backgroundLoading,
})

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(
  io.File file, {
  this.controller,
  this.frameRate,
  this.animate,
  this.reverse,
  this.repeat,
  this.delegates,
  this.options,
  LottieImageProviderFactory? imageProviderFactory,
  this.onLoaded,
  super.key,
  this.frameBuilder,
  this.errorBuilder,
  this.width,
  this.height,
  this.fit,
  this.alignment,
  this.addRepaintBoundary,
  this.filterQuality,
  this.onWarning,
  LottieDecoder? decoder,
  this.renderCache,
  bool? backgroundLoading,
}) : lottie = FileLottie(
        file,
        imageProviderFactory: imageProviderFactory,
        decoder: decoder,
        backgroundLoading: backgroundLoading,
      );