image method

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

Implementation

Image image({
  Key? key,
  ImageFrameBuilder? frameBuilder,
  ImageErrorWidgetBuilder? errorBuilder,
  String? semanticLabel,
  bool excludeFromSemantics = false,
  double? scale,
  double? width,
  double? height,
  Color? color,
  Animation<double>? opacity,
  BlendMode? colorBlendMode,
  BoxFit? fit,
  AlignmentGeometry alignment = Alignment.center,
  ImageRepeat repeat = ImageRepeat.noRepeat,
  Rect? centerSlice,
  bool matchTextDirection = false,
  bool gaplessPlayback = false,
  bool isAntiAlias = false,
  AssetBundle? bundle,
  String? package,
  FilterQuality filterQuality = FilterQuality.low,
  int? cacheWidth,
  int? cacheHeight,
}) {
  final id = pathId;
  if (id.asset) {
    return Image.asset(
      id.path,
      key: key,
      frameBuilder: frameBuilder,
      errorBuilder: errorBuilder,
      semanticLabel: semanticLabel,
      excludeFromSemantics: excludeFromSemantics,
      scale: scale ?? 1.0,
      width: width,
      height: height,
      color: color,
      opacity: opacity,
      colorBlendMode: colorBlendMode,
      fit: fit,
      alignment: alignment,
      repeat: repeat,
      centerSlice: centerSlice,
      matchTextDirection: matchTextDirection,
      gaplessPlayback: gaplessPlayback,
      isAntiAlias: isAntiAlias,
      bundle: bundle,
      package: package,
      filterQuality: filterQuality,
      cacheWidth: cacheWidth,
      cacheHeight: cacheHeight,
    );
  }
  return Image.file(
    File(id.path),
    key: key,
    frameBuilder: frameBuilder,
    errorBuilder: errorBuilder,
    semanticLabel: semanticLabel,
    excludeFromSemantics: excludeFromSemantics,
    scale: scale ?? 1.0,
    width: width,
    height: height,
    color: color,
    opacity: opacity,
    colorBlendMode: colorBlendMode,
    fit: fit,
    alignment: alignment,
    repeat: repeat,
    centerSlice: centerSlice,
    matchTextDirection: matchTextDirection,
    gaplessPlayback: gaplessPlayback,
    isAntiAlias: isAntiAlias,
    filterQuality: filterQuality,
    cacheWidth: cacheWidth,
    cacheHeight: cacheHeight,
  );
}