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>
no setter
hashCode int
The hash code for this object.
no setterinherited
length Future<int>
Get a range of bytes from the input data.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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