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 {
  var result = <String, EpubTextContentFile>{};

  await Future.forEach(textContentFileRefs.keys, (dynamic key) async {
    EpubContentFileRef value = textContentFileRefs[key]!;
    var textContentFile = EpubTextContentFile();
    textContentFile.FileName = value.FileName;
    textContentFile.ContentType = value.ContentType;
    textContentFile.ContentMimeType = value.ContentMimeType;
    textContentFile.Content = await value.readContentAsText();
    result[key] = textContentFile;
  });
  return result;
}