localAsset method

Image localAsset()

Get the image from public/assets/images

Implementation

Image localAsset() {
  assert(this.image is AssetImage, "Image must be an AssetImage");
  if (this.image is AssetImage) {
    AssetImage assetImage = (this.image as AssetImage);
    return Image.asset(
      getImageAsset(assetImage.assetName),
      fit: this.fit,
      width: this.width,
      height: this.height,
      alignment: this.alignment,
      centerSlice: this.centerSlice,
      color: this.color,
      colorBlendMode: this.colorBlendMode,
      excludeFromSemantics: this.excludeFromSemantics,
      filterQuality: this.filterQuality,
      frameBuilder: this.frameBuilder,
      gaplessPlayback: this.gaplessPlayback,
      matchTextDirection: this.matchTextDirection,
      repeat: this.repeat,
      semanticLabel: this.semanticLabel,
      errorBuilder: this.errorBuilder,
      isAntiAlias: this.isAntiAlias,
      package: assetImage.package,
    );
  }
  return this;
}