GetImageCacheNetwork class
This class is used to get the image from the network or from the cache. This GetImageCacheNetwork return a Widget that can be a image or a placeholder. If there is no image in the cache, it will get the image from the network and save it in the cache. If there is an image in the cache, it will get the image from the cache. If there is an error, it will return a placeholder. You can provide a width and height to get a image with the correct size by default would be 64px. You can provide a cacheDuration by default would be 15 days.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- GetImageCacheNetwork
Constructors
- GetImageCacheNetwork({Key? key, required String imageFromNetworkUrl, required String imageFromAssetsUrl, double? width, double? height, BoxFit? fit, double? scale, double? errorWidth, double? errorHeight, BoxFit? errorFit, double? errorScale, Widget? loading, int? cacheDuration, bool showLogs = false})
-
This class is used to get the image from the network or from the cache.
This GetImageCacheNetwork return a Widget that can be a image or a placeholder.
If there is no image in the cache, it will get the image from the network and save it in the cache.
If there is an image in the cache, it will get the image from the cache.
If there is an error, it will return a placeholder.
You can provide a width, height, fit, scale to get a image with the correct size by default would be
64px
, BoxFit.cover,1
. You can provide a errorWidth, errorHeight, errorFit, errorScale to get a image with the correct size by default would be64px
, BoxFit.cover,1
. You can provide a cacheDuration by default would be 15 days. You can decide if you want to see the logs of request management showLogs. If there is not any errorSetting this take from the image setting or in case there is not exist fromdefaults
const
Properties
- cacheDuration → int?
-
final
- errorFit → BoxFit?
-
final
- errorHeight → double?
-
final
- errorScale → double?
-
final
- errorWidth → double?
-
final
- fit → BoxFit?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
final
- imageFromAssetsUrl → String
-
final
- imageFromNetworkUrl → String
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- loading → Widget?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scale → double?
-
final
- showLogs → bool
-
final
- width → double?
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< GetImageCacheNetwork> -
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