NineTileBoxWidget.asset constructor

NineTileBoxWidget.asset({
  1. required String path,
  2. required double tileSize,
  3. required double destTileSize,
  4. Images? images,
  5. double? width,
  6. double? height,
  7. Widget? child,
  8. EdgeInsetsGeometry? padding,
  9. WidgetBuilder? errorBuilder,
  10. WidgetBuilder? loadingBuilder,
  11. Key? key,
})

Loads image from the asset path and renders it as a widget.

It will use the loadingBuilder while the image from path is loading. To render without loading, or when you want to have a gapless playback when the path value changes, consider loading the image beforehand and direct pass it to the default constructor.

Implementation

NineTileBoxWidget.asset({
  required String path,
  required this.tileSize,
  required this.destTileSize,
  Images? images,
  this.width,
  this.height,
  this.child,
  this.padding,
  this.errorBuilder,
  this.loadingBuilder,
  super.key,
}) : _imageFuture = (images ?? Flame.images).load(path);