file static method

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

Created Image widget from XFile

Implementation

static Image file(
  XFile file, {
  BoxFit fit = BoxFit.cover,
  Key? key,
  double scale = 1.0,
  ImageFrameBuilder? frameBuilder,
  ImageErrorWidgetBuilder? errorBuilder,
  String? semanticLabel,
  bool excludeFromSemantics = false,
  double? width,
  double? height,
  Color? color,
  Animation<double>? opacity,
  BlendMode? colorBlendMode,
  AlignmentGeometry alignment = Alignment.center,
  ImageRepeat repeat = ImageRepeat.noRepeat,
  Rect? centerSlice,
  bool matchTextDirection = false,
  bool gaplessPlayback = false,
  bool isAntiAlias = false,
  FilterQuality filterQuality = FilterQuality.low,
  int? cacheWidth,
  int? cacheHeight,
}) {
  return kIsWeb
      ? Image.network(
          file.path,
          key: key,
          scale: scale,
          frameBuilder: frameBuilder,
          errorBuilder: errorBuilder,
          semanticLabel: semanticLabel,
          excludeFromSemantics: excludeFromSemantics,
          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,
        )
      : Image.file(
          File(file.path),
          key: key,
          scale: scale,
          frameBuilder: frameBuilder,
          errorBuilder: errorBuilder,
          semanticLabel: semanticLabel,
          excludeFromSemantics: excludeFromSemantics,
          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,
        );
}