FlutterAssetImageInput class
An implementation of AsyncImageInput
that reads from a Flutter asset.
This class is used by ImageSizeGetter
to read from a Flutter asset.
Example usage:
import 'package:image_size_getter/image_size_getter.dart';
import 'package:image_size_getter_flutter/image_size_getter_flutter.dart';
Future<Size> getAsset(String assetKey) async {
final input = FlutterAssetImageInput(assetKey);
return ImageSizeGetter.getSizeAsync(input);
}
Constructors
- FlutterAssetImageInput(String assetKey)
-
An implementation of
AsyncImageInput
that reads from a Flutter asset.
Properties
- assetKey → String
-
The asset key of flutter asset.
final
-
byteData
→ Future<
Uint8List> -
read-only
- hashCode → int
-
The hash code for this object.
read-onlyinherited
-
length
→ Future<
int> -
Get a range of bytes from the input data.
read-only
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
Methods
-
delegateInput(
) → Future< HaveResourceImageInput> - When asynchronous reading is not supported, an input for real reading will be cached in memory(web) or file(dart.io).
-
exists(
) → Future< bool> - Because the asset is loaded by rootBundle, it is always available.
-
getRange(
int start, int end) → Future< List< int>> - Get a range of bytes from the input data.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
supportRangeLoad(
) → Future< bool> - Whether partial loading is supported.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited