extractFiles function
Extracts various types of files from an EPUB archive.
This function extracts images, CSS files, HTML files, font files, and other files from the provided archive and package. It uses helper functions to extract each type of file.
files
is a list of ArchiveFile
objects representing the files in the EPUB archive.
items
is a list of ManifestItem
objects representing the items in the EPUB package's manifest.
Returns a Files
object containing the extracted files. The Files
object includes separate lists for images, CSS files, HTML files, font files, and other files.
Implementation
Files extractFiles(
final List<ArchiveFile> files,
final List<ManifestItem> items,
) {
return Files(
images: _getImages(files, items),
css: _getCSSFiles(files, items),
html: _getHTMLFiles(files, items),
fonts: _getFontFiles(files, items),
others: _getOtherFiles(files, items),
);
}