readAsString method
Returns a Future that completes with the contents of a text asset.
When decoding as text uses encoding
, or utf8 is not specified.
- 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<String> readAsString(AssetId id, {Encoding encoding = utf8}) async =>
(await _readerWith(id)).readAsString(id, encoding: encoding);