cover static method

Future<Uint8List?> cover({
  1. String? filePath,
  2. Uint8List? bytes,
  3. String? url,
})

Implementation

static Future<Uint8List?> cover({String? filePath, Uint8List? bytes, String? url}) async {
  try {
    final UEpubBook book = await UEpubBook.open(path: filePath, bytes: bytes, url: url);
    final String? href = book.coverHref;
    final Uint8List? data = href == null ? null : await book.resource(href);
    await book.close();
    return data == null || data.isEmpty ? null : data;
  } on Object {
    return null;
  }
}