currentPageAyahs property

List<AyahModel> get currentPageAyahs

Determines if there is a Sajda (prostration) on the given page of Ayahs.

This function iterates through a list of AyahModel representing Ayahs on a page, checking if any Ayah contains a Sajda. If a Sajda is found, and it is either recommended or obligatory, the function updates the application state to indicate the presence of a Sajda on the page.

Parameters: pageAyahs (List<AyahModel>): The list of Ayahs to check for Sajda.

Returns: bool: A boolean value indicating whether a Sajda is present on the page. Retrieves the list of Ayahs on the current page.

This method returns the list of Ayahs on the page currently being viewed.

Returns: List<AyahModel>: The list of Ayahs on the current page.

Implementation

// bool getSajdaInfoForPage(List<AyahModel> pageAyahs) {
//   for (var ayah in pageAyahs) {
//     if (ayah.sajda != false && ayah.sajda is Map) {
//       var sajdaDetails = ayah.sajda;
//       if (sajdaDetails['recommended'] == true ||
//           sajdaDetails['obligatory'] == true) {
//         return state.isSajda.value = true;
//       }
//     }
//   }
//   // No sajda found on this page
//   return
// }

/// Retrieves the list of Ayahs on the current page.
///
/// This method returns the list of Ayahs on the page currently being viewed.
///
/// Returns:
///   `List<AyahModel>`: The list of Ayahs on the current page.
List<AyahModel> get currentPageAyahs =>
    state.pages[state.currentPageNumber.value];