extendedImageFile function

Widget extendedImageFile(
  1. String imageUri, {
  2. Key? key,
  3. BoxFit? fit,
  4. Color? color,
  5. double? width,
  6. double? height,
  7. Alignment alignment = Alignment.center,
  8. BlendMode? colorBlendMode,
  9. bool excludeFromSemantics = false,
  10. bool matchTextDirection = false,
  11. Widget? placeholder,
  12. double scale = 1.0,
  13. FilterQuality filterQuality = FilterQuality.low,
  14. bool isAntiAlias = false,
  15. ImageRepeat repeat = ImageRepeat.noRepeat,
  16. Rect? centerSlice,
  17. String? semanticLabel,
  18. bool gaplessPlayback = false,
  19. int? cacheWidth,
  20. int? cacheHeight,
  21. Widget? errorPlaceholder,
  22. bool enableMemoryCache = true,
  23. bool clearMemoryCacheIfFailed = true,
  24. bool clearMemoryCacheWhenDispose = false,
  25. int? maxBytes,
  26. double? compressionRatio,
})

Create extended image widget

Implementation

Widget extendedImageFile(
  String imageUri, {
  Key? key,
  BoxFit? fit,
  Color? color,
  double? width,
  double? height,
  Alignment alignment = Alignment.center,
  BlendMode? colorBlendMode,
  bool excludeFromSemantics = false,
  bool matchTextDirection = false,
  Widget? placeholder,
  double scale = 1.0,
  FilterQuality filterQuality = FilterQuality.low,
  bool isAntiAlias = false,
  ImageRepeat repeat = ImageRepeat.noRepeat,
  Rect? centerSlice,
  String? semanticLabel,
  bool gaplessPlayback = false,
  int? cacheWidth,
  int? cacheHeight,
  Widget? errorPlaceholder,
  bool enableMemoryCache = true,
  bool clearMemoryCacheIfFailed = true,
  bool clearMemoryCacheWhenDispose = false,
  int? maxBytes,
  double? compressionRatio,
}) {
  return ExtendedImage.file(
    File(imageUri),
    key: key,
    fit: fit,
    scale: scale,
    color: color,
    width: width,
    height: height,
    alignment: alignment,
    filterQuality: filterQuality,
    colorBlendMode: colorBlendMode,
    isAntiAlias: isAntiAlias,
    repeat: repeat,
    centerSlice: centerSlice,
    semanticLabel: semanticLabel,
    excludeFromSemantics: excludeFromSemantics,
    matchTextDirection: matchTextDirection,
    gaplessPlayback: gaplessPlayback,
    cacheWidth: cacheWidth,
    cacheHeight: cacheHeight,
    loadStateChanged: placeholder != null
        ? (ExtendedImageState state) {
            switch (state.extendedImageLoadState) {
              case LoadState.loading:
                return placeholder;
              case LoadState.failed:
                return errorPlaceholder ?? placeholder;
              default:
                return null;
            }
          }
        : null,
    enableMemoryCache: enableMemoryCache,
    clearMemoryCacheIfFailed: clearMemoryCacheIfFailed,
    clearMemoryCacheWhenDispose: clearMemoryCacheWhenDispose,
    maxBytes: maxBytes,
    compressionRatio: compressionRatio,
  );
}