getJuzByPage method

AyahModel getJuzByPage(
  1. int page
)

Retrieves the Juz data for a given page number.

This method returns the AyahModel of the Juz that contains the first Ayah on the specified page.

Parameters: page (int): The page number for which to retrieve the Juz data.

Returns: AyahModel: The AyahModel representing the Juz of the first Ayah on the specified page. If no Ayah is found, an empty AyahModel is returned.

Implementation

AyahModel getJuzByPage(int page) {
  return state.allAyahs.firstWhere(
    (a) => a.page == page + 1,
    orElse: () => AyahModel.empty(),
  );
}