getPageData function
Takes pageNumber
and returns a list containing Surahs and the starting and ending Verse numbers in that page
Example:
getPageData(604);
Returns List of Page 604:
[{surah: 112, start: 1, end: 5}, {surah: 113, start: 1, end: 4}, {surah: 114, start: 1, end: 5}]
Length of the list is the number of surah in that page.
Implementation
List getPageData(int pageNumber) {
if (pageNumber < 1 || pageNumber > 604) {
throw "Invalid page number. Page number must be between 1 and 604";
}
return pageData[pageNumber - 1];
}