readAsBytes method
Returns a Future that completes with the bytes of a binary asset.
- Throws a
PackageNotFoundException
ifid.package
is not found. - Throws a
AssetNotFoundException
ifid.path
is not found. - Throws an
InvalidInputException
ifid
is an invalid input.
Implementation
@override
Future<List<int>> readAsBytes(AssetId id) =>
_resolve(id)?.readAsBytes() ?? (throw AssetNotFoundException(id));