readAsString method Null safety

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.

Implementation

Future<String> readAsString(AssetId id, {Encoding encoding = utf8});