NineTileBoxWidget.asset constructor
NineTileBoxWidget.asset({
- required String path,
- required double tileSize,
- required double destTileSize,
- Images? images,
- double? width,
- double? height,
- Widget? child,
- EdgeInsetsGeometry? padding,
- WidgetBuilder? errorBuilder,
- WidgetBuilder? loadingBuilder,
- 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);