Fetches an image from an AssetBundle, associating it with the given scale.
This implementation requires an explicit final name and scale on construction, and ignores the device pixel ratio and size in the configuration passed into resolve. For a resolution-aware variant that uses the configuration to pick an appropriate image based on the device pixel ratio and size, see AssetImage.
- Inheritance
- Object
- ImageProvider<AssetBundleImageKey>
- AssetBundleImageProvider
- ExactAssetImage
Constructors
- ExactAssetImage(String name, { double scale: 1.0, AssetBundle bundle })
-
Creates an object that fetches the given image from an asset bundle.
Properties
- bundle → AssetBundle
-
The bundle from which the image will be obtained.
read-only - hashCode → int
-
read-only
- name → String
-
The key to use to obtain the resource from the bundle. This is the argument passed to AssetBundle.load.
read-only - scale → double
-
The scale to place in the ImageInfo object of the image.
read-only - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Operators
-
operator ==(
other) → bool -
The equality operator.
Methods
-
obtainKey(
ImageConfiguration configuration) → Future<AssetBundleImageKey> -
Converts an ImageProvider's settings plus an ImageConfiguration to a key that describes the precise image to load.
-
toString(
) → String -
Returns a string representation of this object.
-
decodeImage(
ByteData data) → Future<Image> -
Converts raw image data from a ByteData buffer into a decoded ui.Image which can be passed to a
Canvas
.inherited -
load(
AssetBundleImageKey key) → ImageStreamCompleter -
Converts a key into an ImageStreamCompleter, and begins fetching the image using loadAsync.
inherited -
loadAsync(
AssetBundleImageKey key) → Future<ImageInfo> -
Fetches the image from the asset bundle, decodes it, and returns a corresponding ImageInfo object.
inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited -
resolve(
ImageConfiguration configuration) → ImageStream -
Resolves this image provider using the given
configuration
, returning an ImageStream.inherited