readTextContentFiles static method

Future<Map<String, EpubTextContentFile>> readTextContentFiles(
  1. Map<String, EpubTextContentFileRef> textContentFileRefs
)

Implementation

static Future<Map<String, EpubTextContentFile>> readTextContentFiles(
    Map<String, EpubTextContentFileRef> textContentFileRefs) async {
  final result = <String, EpubTextContentFile>{};

  await Future.forEach(textContentFileRefs.keys, (String key) async {
    EpubContentFileRef value = textContentFileRefs[key]!;
    final textContentFile = EpubTextContentFile(
      value.fileName,
      value.contentType,
      value.contentMimeType,
      await value.readContentAsText(),
    );
    result[key] = textContentFile;
  });
  return result;
}