readAsString method

Future<String> readAsString([
  1. String? relativePath
])

Reads a text representation of the file (or subfile).

Implementation

Future<String> readAsString([String? relativePath]) async {
  final bytes = relativePath != null
      ? await getSubFileBytes(relativePath)
      : await getBytes();
  return utf8.decode(bytes, allowMalformed: true);
}