Image.asset constructor

Image.asset(
  1. String name, {
  2. Key? key,
  3. AssetBundle? bundle,
  4. Widget frameBuilder(
    1. BuildContext,
    2. Widget,
    3. int?,
    4. bool,
    )?,
  5. Widget errorBuilder(
    1. BuildContext,
    2. Object,
    3. StackTrace?
    )?,
  6. String? semanticLabel,
  7. bool excludeFromSemantics = false,
  8. double? scale,
  9. double? width,
  10. double? height,
  11. Color? color,
  12. double? opacity,
  13. BlendMode? colorBlendMode,
  14. BoxFit? fit,
  15. AlignmentGeometry alignment = Alignment.center,
  16. ImageRepeat repeat = ImageRepeat.noRepeat,
  17. Rect? centerSlice,
  18. bool matchTextDirection = false,
  19. bool gaplessPlayback = false,
  20. bool isAntiAlias = false,
  21. String? package,
  22. FilterQuality filterQuality = FilterQuality.medium,
  23. int? cacheWidth,
  24. int? cacheHeight,
})

Implementation

Image.asset(
  String name, {
  super.key,
  AssetBundle? bundle,
  this.frameBuilder,
  this.errorBuilder,
  this.semanticLabel,
  this.excludeFromSemantics = false,
  double? scale,
  this.width,
  this.height,
  this.color,
  this.opacity,
  this.colorBlendMode,
  this.fit,
  this.alignment = Alignment.center,
  this.repeat = ImageRepeat.noRepeat,
  this.centerSlice,
  this.matchTextDirection = false,
  this.gaplessPlayback = false,
  this.isAntiAlias = false,
  String? package,
  this.filterQuality = FilterQuality.medium,
  this.cacheWidth,
  this.cacheHeight,
}) : image = AssetImage(
        name,
        bundle: bundle,
        package: package,
      );