getCover method

Future<Uint8List> getCover({
  1. required int coverId,
  2. required CoverSize coverSize,
})

This function getCover is called implicit but can also be called from outside to load a cover as Uint8List. If there is no cover it returns an empty Uint8List. Use coverId to specify it's OL ID and coverSize S/M/L CoverSize to load

Implementation

Future<Uint8List> getCover(
    {required int coverId, required CoverSize coverSize}) async {
  final Uint8List cover = await _openLibraryApiService.getCoverById(
      id: coverId.toString(), size: coverSize.name);
  return cover;
}