FastCachedImage class

Inheritance

Constructors

FastCachedImage({required String url, Map<String, dynamic>? headers, double scale = 1.0, ImageErrorWidgetBuilder? errorBuilder, String? semanticLabel, Widget loadingBuilder(BuildContext, FastCachedProgressData)?, bool excludeFromSemantics = false, bool showErrorLog = true, 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, FilterQuality filterQuality = FilterQuality.low, Duration fadeInDuration = const Duration(milliseconds: 500), int? cacheWidth, int? cacheHeight, Key? key})
FastCachedImage creates a widget to display network images. This widget downloads the network image when this widget is build for the first time. Later whenever this widget is called the image will be displayed from the downloaded database instead of the network. This can avoid unnecessary downloads and load images much faster.
const

Properties

alignment AlignmentGeometry
The alignment aligns the given position in the image to the given position in the layout bounds. For example, an Alignment alignment of (-1.0, -1.0) aligns the image to the top-left corner of its layout bounds, while an Alignment alignment of (1.0, 1.0) aligns the bottom right of the image with the bottom right corner of its layout bounds. Similarly, an alignment of (0.0, 1.0) aligns the bottom middle of the image with the middle of the bottom edge of its layout bounds.
final
cacheHeight int?
final
cacheWidth int?
final
centerSlice Rect?
centerSlice property in Flutter memory image.
final
color Color?
color property in Flutter memory image.
final
colorBlendMode BlendMode?
colorBlendMode property in Flutter memory image
final
errorBuilder ImageErrorWidgetBuilder?
errorBuilder must return a widget. This widget will be displayed if there is any error in downloading or displaying the downloaded image
final
excludeFromSemantics bool
excludeFromSemantics property in Flutter memory image.
final
fadeInDuration Duration
fadeInDuration can be adjusted to change the duration of the fade transition between the loadingBuilder and the actual image. Default value is 500 ms.
final
filterQuality FilterQuality
If the pixels are not perfectly aligned with the screen pixels, or if the image itself is of a low quality, FilterQuality.none may produce undesirable artifacts. Consider using other FilterQuality values to improve the rendered image quality in this case. Pixels may be misaligned with the screen pixels as a result of transforms or scaling. opacity can be used to adjust the opacity of the image. Used to combine color with this image.
final
fit BoxFit?
fit How a box should be inscribed into another box
final
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.
final
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, dynamic>?
Provide the headers for the image to display.
final
height double?
height of the image
final
isAntiAlias bool
isAntiAlias property in Flutter memory image.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loadingBuilder → (Widget Function(BuildContext, FastCachedProgressData)?)
loadingBuilder is the builder which can show the download progress of an image. Usage: loadingBuilder(context, FastCachedProgressData progressData){return Text('${progress.downloadedBytes ~/ 1024} / ${progress.totalBytes! ~/ 1024} kb')}
final
matchTextDirection bool
matchTextDirection property in Flutter memory image.
final
opacity Animation<double>?
opacity property in Flutter memory image.
final
repeat ImageRepeat
repeat property in Flutter memory image.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scale double
scale property in Flutter memory image.
final
semanticLabel String?
semanticLabel property in Flutter memory image.
final
showErrorLog bool
showErrorLog can be set to true if you want to ignore error logs from the widget
final
url String
Provide the url for the image to display.
final
width double?
If cacheWidth or cacheHeight are provided, it indicates to the engine that the image must be decoded at the specified size. The image will be rendered to the constraints of the layout or width and height regardless of these parameters. These parameters are primarily intended to reduce the memory usage of ImageCache. If non-null, this color is blended with each image pixel using colorBlendMode. If the image is of a high quality and its pixels are perfectly aligned with the physical screen pixels, extra quality enhancement may not be necessary. If so, then FilterQuality.none would be the most efficient. width width of the image
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<FastCachedImage>
Creates the mutable state for this widget at a given location in the tree.
override
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