getDocumentContentAsString function
Helper method to read document using
getDocumentContent
and get the content as String instead as Uint8List
.
Implementation
Future<String?> getDocumentContentAsString(
Uri uri, {
bool throwIfError = false,
}) async {
final bytes = await getDocumentContent(uri);
if (bytes == null) return null;
return String.fromCharCodes(bytes);
}