BaseImage class

Inheritance
Available extensions

Constructors

BaseImage(ImageProvider<Object> image, {Key? key, String? semanticLabel, bool excludeFromSemantics = false, double? width, double? height, Color? color, Animation<double>? opacity, BlendMode? colorBlendMode, BoxFit? fit = BoxFit.cover, AlignmentGeometry alignment = Alignment.center, ImageRepeat repeat = ImageRepeat.noRepeat, Rect? centerSlice, bool matchTextDirection = false, bool gaplessPlayback = false, FilterQuality filterQuality = FilterQuality.low, LoadStateChanged? loadStateChanged, BoxBorder? border, BoxShape? shape = BoxShape.rectangle, BorderRadius? borderRadius = const BorderRadius.all(Radius.circular(2)), Clip clipBehavior = Clip.antiAlias, bool enableLoadState = false, BeforePaintImage? beforePaintImage, AfterPaintImage? afterPaintImage, ExtendedImageMode mode = ExtendedImageMode.none, bool enableMemoryCache = true, bool clearMemoryCacheIfFailed = true, DoubleTap? onDoubleTap, InitGestureConfigHandler? initGestureConfigHandler, bool enableSlideOutPage = false, BoxConstraints? constraints, Key? extendedImageEditorKey, InitEditorConfigHandler? initEditorConfigHandler, HeroBuilderForSlidingPage? heroBuilderForSlidingPage, bool clearMemoryCacheWhenDispose = false, Key? extendedImageGestureKey, bool isAntiAlias = false, bool handleLoadingProgress = false, EdgeInsets layoutInsets = EdgeInsets.zero})
BaseImage.asset(String? name, {Key? key, AssetBundle? bundle, String? semanticLabel, bool excludeFromSemantics = false, double? scale, double? width, double? height, Color? color, Animation<double>? opacity, BlendMode? colorBlendMode, BoxFit? fit = BoxFit.cover, AlignmentGeometry alignment = Alignment.center, ImageRepeat repeat = ImageRepeat.noRepeat, Rect? centerSlice, bool matchTextDirection = false, bool gaplessPlayback = false, String? package, FilterQuality filterQuality = FilterQuality.low, BoxShape? shape = BoxShape.rectangle, BoxBorder? border, BorderRadius? borderRadius = const BorderRadius.all(Radius.circular(2)), Clip clipBehavior = Clip.antiAlias, bool enableLoadState = false, BeforePaintImage? beforePaintImage, AfterPaintImage? afterPaintImage, ExtendedImageMode mode = ExtendedImageMode.none, bool enableMemoryCache = true, bool clearMemoryCacheIfFailed = true, DoubleTap? onDoubleTap, InitGestureConfigHandler? initGestureConfigHandler, bool enableSlideOutPage = false, BoxConstraints? constraints, Key? extendedImageEditorKey, InitEditorConfigHandler? initEditorConfigHandler, HeroBuilderForSlidingPage? heroBuilderForSlidingPage, bool clearMemoryCacheWhenDispose = false, Key? extendedImageGestureKey, int? cacheWidth, int? cacheHeight, bool isAntiAlias = false, double? compressionRatio, int? maxBytes, bool cacheRawData = false, String? imageCacheName, EdgeInsets layoutInsets = EdgeInsets.zero, Widget? failed, Widget? loading})
BaseImage.dynamic(dynamic image, {Key? key, String? semanticLabel, bool excludeFromSemantics = false, double? width, double? height, Color? color, Animation<double>? opacity, BlendMode? colorBlendMode, BoxFit? fit = BoxFit.cover, AlignmentGeometry alignment = Alignment.center, ImageRepeat repeat = ImageRepeat.noRepeat, Rect? centerSlice, bool matchTextDirection = false, bool gaplessPlayback = false, FilterQuality filterQuality = FilterQuality.low, BoxBorder? border, BoxShape? shape = BoxShape.rectangle, BorderRadius? borderRadius = const BorderRadius.all(Radius.circular(2)), Clip clipBehavior = Clip.antiAlias, bool enableLoadState = true, BeforePaintImage? beforePaintImage, AfterPaintImage? afterPaintImage, ExtendedImageMode mode = ExtendedImageMode.none, bool enableMemoryCache = true, bool clearMemoryCacheIfFailed = true, DoubleTap? onDoubleTap, InitGestureConfigHandler? initGestureConfigHandler, bool enableSlideOutPage = false, BoxConstraints? constraints, Key? extendedImageEditorKey, InitEditorConfigHandler? initEditorConfigHandler, HeroBuilderForSlidingPage? heroBuilderForSlidingPage, bool clearMemoryCacheWhenDispose = false, Key? extendedImageGestureKey, bool isAntiAlias = false, bool handleLoadingProgress = false, EdgeInsets layoutInsets = EdgeInsets.zero, Widget? failed, Widget? loading, int? cacheWidth, int? cacheHeight, double? compressionRatio, int? maxBytes, bool cacheRawData = false, String? imageCacheName, double scale = 1.0, Map<String, String>? headers, bool cache = true, int retries = 3, Duration? timeLimit, Duration timeRetry = const Duration(milliseconds: 100), CancellationToken? cancelToken, String? cacheKey, bool printError = true, Duration? cacheMaxAge, AssetBundle? bundle, String? package})
BaseImage.file(File file, {Key? key, double scale = 1.0, String? semanticLabel, bool excludeFromSemantics = false, double? width, double? height, Color? color, Animation<double>? opacity, BlendMode? colorBlendMode, BoxFit? fit = BoxFit.cover, AlignmentGeometry alignment = Alignment.center, ImageRepeat repeat = ImageRepeat.noRepeat, Rect? centerSlice, bool matchTextDirection = false, bool gaplessPlayback = false, FilterQuality filterQuality = FilterQuality.low, BoxShape? shape = BoxShape.rectangle, BoxBorder? border, BorderRadius? borderRadius = const BorderRadius.all(Radius.circular(2)), Clip clipBehavior = Clip.antiAlias, bool enableLoadState = false, BeforePaintImage? beforePaintImage, AfterPaintImage? afterPaintImage, ExtendedImageMode mode = ExtendedImageMode.none, bool enableMemoryCache = true, bool clearMemoryCacheIfFailed = true, DoubleTap? onDoubleTap, InitGestureConfigHandler? initGestureConfigHandler, bool enableSlideOutPage = false, BoxConstraints? constraints, Key? extendedImageEditorKey, InitEditorConfigHandler? initEditorConfigHandler, HeroBuilderForSlidingPage? heroBuilderForSlidingPage, bool clearMemoryCacheWhenDispose = false, Key? extendedImageGestureKey, int? cacheWidth, int? cacheHeight, bool isAntiAlias = false, double? compressionRatio, int? maxBytes, bool cacheRawData = false, String? imageCacheName, EdgeInsets layoutInsets = EdgeInsets.zero, Widget? failed, Widget? loading})
BaseImage.memory(Uint8List bytes, {Key? key, double scale = 1.0, String? semanticLabel, bool excludeFromSemantics = false, double? width, double? height, Color? color, Animation<double>? opacity, BlendMode? colorBlendMode, BoxFit? fit = BoxFit.cover, AlignmentGeometry alignment = Alignment.center, ImageRepeat repeat = ImageRepeat.noRepeat, Rect? centerSlice, bool matchTextDirection = false, bool gaplessPlayback = false, FilterQuality filterQuality = FilterQuality.low, BoxShape? shape = BoxShape.rectangle, BoxBorder? border, BorderRadius? borderRadius = const BorderRadius.all(Radius.circular(2)), Clip clipBehavior = Clip.antiAlias, bool enableLoadState = false, BeforePaintImage? beforePaintImage, AfterPaintImage? afterPaintImage, ExtendedImageMode mode = ExtendedImageMode.none, bool enableMemoryCache = true, bool clearMemoryCacheIfFailed = true, DoubleTap? onDoubleTap, InitGestureConfigHandler? initGestureConfigHandler, bool enableSlideOutPage = false, BoxConstraints? constraints, Key? extendedImageEditorKey, InitEditorConfigHandler? initEditorConfigHandler, HeroBuilderForSlidingPage? heroBuilderForSlidingPage, bool clearMemoryCacheWhenDispose = false, Key? extendedImageGestureKey, int? cacheWidth, int? cacheHeight, bool isAntiAlias = false, double? compressionRatio, int? maxBytes, bool cacheRawData = false, String? imageCacheName, EdgeInsets layoutInsets = EdgeInsets.zero, Widget? failed, Widget? loading})
BaseImage.network(String? url, {Key? key, String? semanticLabel, bool excludeFromSemantics = false, double? width, double? height, Color? color, Animation<double>? opacity, BlendMode? colorBlendMode, BoxFit? fit = BoxFit.cover, AlignmentGeometry alignment = Alignment.center, ImageRepeat repeat = ImageRepeat.noRepeat, Rect? centerSlice, bool matchTextDirection = false, bool gaplessPlayback = false, FilterQuality filterQuality = FilterQuality.low, BoxShape? shape = BoxShape.rectangle, BoxBorder? border, BorderRadius? borderRadius = const BorderRadius.all(Radius.circular(2)), Clip clipBehavior = Clip.antiAlias, bool enableLoadState = true, BeforePaintImage? beforePaintImage, AfterPaintImage? afterPaintImage, ExtendedImageMode mode = ExtendedImageMode.none, bool enableMemoryCache = true, bool clearMemoryCacheIfFailed = true, DoubleTap? onDoubleTap, InitGestureConfigHandler? initGestureConfigHandler, bool enableSlideOutPage = false, BoxConstraints? constraints, CancellationToken? cancelToken, int retries = 3, Duration? timeLimit, Map<String, String>? headers, bool cache = true, double scale = 1.0, Duration timeRetry = const Duration(milliseconds: 100), Key? extendedImageEditorKey, InitEditorConfigHandler? initEditorConfigHandler, HeroBuilderForSlidingPage? heroBuilderForSlidingPage, bool clearMemoryCacheWhenDispose = false, bool handleLoadingProgress = false, Key? extendedImageGestureKey, int? cacheWidth, int? cacheHeight, bool isAntiAlias = false, String? cacheKey, bool printError = true, double? compressionRatio, int? maxBytes, bool cacheRawData = false, String? imageCacheName, Duration? cacheMaxAge, EdgeInsets layoutInsets = EdgeInsets.zero, Widget? failed, Widget? loading})

Properties

afterPaintImage AfterPaintImage?
you can paint anything if you want after paint image. it's to used in ExtendedRawImage and ExtendedRenderImage
finalinherited
alignment AlignmentGeometry
How to align the image within its bounds.
finalinherited
beforePaintImage BeforePaintImage?
you can paint anything if you want before paint image. it's to used in ExtendedRawImage and ExtendedRenderImage
finalinherited
border BoxBorder?
A border to draw above the background color, gradient, or image.
finalinherited
borderRadius BorderRadius?
If non-null, the corners of this box are rounded by this BorderRadius.
finalinherited
centerSlice Rect?
The center slice for a nine-patch image.
finalinherited
clearMemoryCacheIfFailed bool
when failed to load image, whether clear memory cache if true, image will reload in next time.
finalinherited
clearMemoryCacheWhenDispose bool
when image is removed from the tree permanently, whether clear memory cache
finalinherited
clipBehavior Clip
finalinherited
color Color?
If non-null, this color is blended with each image pixel using colorBlendMode.
finalinherited
colorBlendMode BlendMode?
Used to combine color with this image.
finalinherited
constraints BoxConstraints?
finalinherited
enableLoadState bool
whether has loading or failed state default is false but network image is true better to set it's true when your image is big and take some time to ready
finalinherited
enableMemoryCache bool
whether cache in PaintingBinding.instance.imageCache
finalinherited
enableSlideOutPage bool
whether enable slide out page you should make sure this is in ExtendedImageSlidePage
finalinherited
excludeFromSemantics bool
Whether to exclude this image from semantics.
finalinherited
extendedImageEditorKey Key?
key of ExtendedImageEditor
finalinherited
extendedImageGestureKey Key?
key of ExtendedImageGesture
finalinherited
filterQuality FilterQuality
Used to set the FilterQuality of the image.
finalinherited
fit BoxFit?
How to inscribe the image into the space allocated during layout.
finalinherited
gaplessPlayback bool
Whether to continue showing the old image (true), or briefly show nothing (false), when the image provider changes. The default value is false.
finalinherited
handleLoadingProgress bool
whether handle loading progress for network
finalinherited
hashCode int
The hash code for this object.
no setterinherited
height double?
If non-null, require the image to have this height.
finalinherited
heroBuilderForSlidingPage HeroBuilderForSlidingPage?
build Hero only for sliding page
finalinherited
image ImageProvider<Object>
The image to display.
finalinherited
initEditorConfigHandler InitEditorConfigHandler?
init EditConfig when image is ready.
finalinherited
initGestureConfigHandler InitGestureConfigHandler?
init GestureConfig when image is ready.
finalinherited
isAntiAlias bool
Whether to paint the image with anti-aliasing.
finalinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
layoutInsets EdgeInsets
Insets to apply before laying out the image.
finalinherited
loadStateChanged LoadStateChanged?
custom load state widget if you want
finalinherited
matchTextDirection bool
Whether to paint the image in the direction of the TextDirection.
finalinherited
mode ExtendedImageMode
image mode (none,gesture)
finalinherited
onDoubleTap DoubleTap?
call back of double tap under ExtendedImageMode.gesture
finalinherited
opacity Animation<double>?
If non-null, the value from the Animation is multiplied with the opacity of each image pixel before painting onto the canvas.
finalinherited
repeat ImageRepeat
How to paint any portions of the layout bounds not covered by the image.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semanticLabel String?
A Semantic description of the image.
finalinherited
shape BoxShape?
The shape to fill the background color, gradient, and image into and to cast as the boxShadow.
finalinherited
width double?
If non-null, require the image to have this width.
finalinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _ExtendedImageState
Creates the mutable state for this widget at a given location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

buildLoadStateChanged({Widget? failed, Widget? loading}) LoadStateChanged