extendedImageFile function
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,
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,
);
}