getSurahs method

Future<Map<String, dynamic>> getSurahs()

Fetches the list of Surahs from the data source.

This method returns a Future that completes with a Map containing the Surah data. The keys in the map are the Surah identifiers, and the values are the corresponding Surah details.

Returns: A Future that completes with a Map<String, dynamic> containing the Surah data.

Throws: An exception if there is an error while fetching the Surah data.

Implementation

Future<Map<String, dynamic>> getSurahs() async {
  String content = await rootBundle
      .loadString('packages/quran_library/assets/jsons/surahs_name.json');
  return jsonDecode(content);
}