ImageAsset class
Image/Texture asset
Read straight from the asset bundle — the bundle is already on the device, so nothing is copied into the engine's persistent cache. AssetManager keeps the decoded image in memory until the asset is unloaded.
Constructors
- ImageAsset(String path)
- Constructor
Properties
- data → Uint8List?
-
The encoded bytes (PNG, JPEG…) while the image is being decoded.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → int
-
Image height
no setter
- image → Image?
-
Get the loaded image
no setter
- isLoaded → bool
-
Get load status
no setterinherited
- manager → AssetManager?
-
The manager loading this asset — set before load runs — or null for
an asset loaded on its own. An asset that loads others (an atlas its
JSON and page images) loads them through it.
no setterinherited
- path → String
-
Asset identifier/path
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → AssetType
-
Asset type
finalinherited
- width → int
-
Image width
no setter
Methods
-
getMemoryUsage(
) → int -
Get memory usage in bytes
override
-
load(
) → Future< void> -
Load the asset
override
-
markAsLoaded(
) → void -
Mark the asset as successfully loaded.
inherited
-
markAsUnloaded(
) → void -
Mark the asset as unloaded. Call this from unload in such subclasses.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
unload(
) → void -
Disposes the decoded image.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited