getChapterFilenames function Null safety

Future<List<String>> getChapterFilenames(
  1. String chapterId,
  2. bool isDataSaverMode
)

Gets the chapter filenames just using the chapterId of a chapter. returns a List of String containing all the file names of a chapter.

Implementation

Future<List<String>> getChapterFilenames(
    String chapterId, bool isDataSaverMode) async {
  var response = await getChapterDataByChapterId(chapterId);
  if (isDataSaverMode == true) {
    return response.chapter.dataSaver;
  } else {
    return response.chapter.data;
  }
}