The quran_sharif
package provides utility functions to retrieve information from the Quran, such as surahs, ayahs, and other related data. It depends on the quran_sharif.arabic_data_model
package, which includes the necessary data models for representing Quranic data in Arabic.
To use the quran_sharif
package, follow these steps:
-
Add the package to your
pubspec.yaml
file:dependencies: quran_sharif: <latest_version>
-
Import the package:
import 'package:quran_sharif/quran_sharif.dart';
-
Use the provided methods to access the Quran data:
void main() { // Retrieve all surahs List<Surahs> allSurahs = Quran.getAllSurah(); // Get surah by ID Surahs? surah = Quran.getSurahById(id: 1); // Get a list of surah names List<String> surahNames = Quran.getSurahName(); // Filter surahs by revelation type List<Surahs> makkiSurahs = Quran.getSurahByRevelationType(isMakki: true); // Get ayahs by Juz ID List<Ayahs> juzAyahs = Quran.getJuz(id: 1); // Perform operations on Quranic data // ... }
The Quran
class provides methods to retrieve Quranic data.
Retrieves all surahs from the Quran.
Retrieves a specific surah from the Quran based on its ID.
id
: The ID of the surah.
Returns: An instance of Surahs
if found, or null
if not found.
Retrieves a list of surah names from the Quran.
Returns: A list of surah names as String
.
Filters surahs from the Quran based on the revelation type.
isMakki
: A boolean value indicating whether to filter Makki surahs (true) or Madani surahs (false).
Returns: A list of Surahs
filtered by the revelation type.
Retrieves ayahs from the Quran based on the Juz ID.
id
: The ID of the Juz.
Returns: A list of Ayahs
belonging to the specified Juz ID.
For more details on each class and its properties, refer to the API documentation.
For the complete API reference, see the quran_sharif API Documentation.