readAsString method

  1. @override
Future<String> readAsString(
  1. AssetId id,
  2. {Encoding encoding = utf8}

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 if id.package is not found.
  • Throws a AssetNotFoundException if id.path is not found.
  • Throws an InvalidInputException if id is an invalid input.


Future<String> readAsString(AssetId id, {Encoding encoding = utf8}) async =>
    (await _readerWith(id)).readAsString(id, encoding: encoding);