hasBookmark method

bool hasBookmark(
  1. int surahNum,
  2. int ayahUQNum,
  3. List? bookmarkList
)

Checks if the given bookmark list contains a bookmark with the given Surah number and Ayah UQ number.

Returns: true if the bookmark exists, false otherwise.

Implementation

bool hasBookmark(int surahNum, int ayahUQNum, List? bookmarkList) =>
    (bookmarkList!.firstWhereOrNull(((element) =>
                element.surahNumber == surahNum &&
                element.ayahUQNumber == ayahUQNum)) !=
            null)
        ? true
        : false;