Quran text (Arabic), audio URLs, and details of pages, juz, surah, ayah, place of revelation etc.
Getting Started
To use this plugin, add quran
as a dependency in your pubspec.yaml file.
Constants:
basmala
- The constant 'بِسْمِ ٱللَّهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ'sajdah
- The constant 'سَجْدَةٌ'totalJuzCount
- The constant total juz counttotalMadaniSurahs
- The constant total of madani surahstotalMakkiSurahs
- The constant total of makki surahstotalPagesCount
- The most standard and common copy of Arabic only Quran total pages counttotalSurahCount
- The constant total surah counttotalVerseCount
- The constant total verse count
Functions:
Juz:
getJuzNumber(int surahNumber, int verseNumber)
- TakessurahNumber
&verseNumber
and returns Juz numbergetSurahAndVersesFromJuz(int juzNumber)
- TakesjuzNumber
and returns a map containing Surah and Verse numbers
Surah:
getSurahName(int surahNumber)
- TakessurahNumber
and returns the Surah namegetSurahNameArabic(int surahNumber)
- TakessurahNumber
returns the Surah name in ArabicgetSurahNameEnglish(int surahNumber)
- TakessurahNumber
returns the Surah name in EnglishgetSurahNameTurkish(int surahNumber)
- TakessurahNumber
returns the Surah name in TurkishgetSurahNameFrench(int surahNumber)
- TakessurahNumber
returns the Surah name in FrenchgetPlaceOfRevelation(int surahNumber)
- TakessurahNumber
and returns the Place of Revelation (Makkah / Madinah) of that SurahgetVerseCount(int surahNumber)
- TakessurahNumber
and returns the count of total Verses in that Surah
Verse:
-
getVerse(int surahNumber, int verseNumber, {bool verseEndSymbol})
- TakessurahNumber
,verseNumber
&verseEndSymbol
(optional) and returns the Verse in Arabic -
getVerseEndSymbol(int verseNumber, {bool arabicNumeral})
- TakesverseNumber
,arabicNumeral
(optional) and returns '' symbol with verse number -
isSajdahVerse(int surahNumber, int verseNumber)
- TakessurahNumber
,verseNumber
and returns true if verse is sajdah verse -
getVerseTranslation(int surahNumber, int verseNumber, {bool verseEndSymbol, Translation translation})
- TakessurahNumber
,verseNumber
,verseEndSymbol
(optional) &translation
(optional) and returns verse translation -
Random Verse - Use
RandomVerse
class to create a random verse. Example:RandomVerse randomVerse = RandomVerse(); print(randomVerse.surahNumber); print(randomVerse.verseNumber); print(randomVerse.verse); print(randomVerse.translation);
Page:
getPageData(int pageNumber)
- TakespageNumber
and returns a list containing Surahs and the starting and ending Verse numbers in that pagegetPageNumber(int surahNumber, int verseNumber)
- TakessurahNumber
,verseNumber
and returns the page number of the QurangetSurahCountByPage(int pageNumber)
- TakespageNumber
and returns total surahs count in that pagegetSurahPages(int surahNumber)
- TakessurahNumber
and returns the list of page numbers of that surahgetVerseCountByPage(int pageNumber)
- TakespageNumber
and returns total verses count in that pagegetVersesTextByPage(int pageNumber, {bool verseEndSymbol, SurahSeperator surahSeperator, customSurahSeperator})
- TakespageNumber
,verseEndSymbol
,surahSeperator
&customSurahSeperator
and returns the list of verses in that page
URLs:
getAudioURLBySurah(int surahNumber)
- TakessurahNumber
and returns audio URL of that surahgetAudioURLByVerse(int surahNumber, int verseNumber)
- TakessurahNumber
&verseNumber
and returns audio URL of that versegetAudioURLByVerseNumber(int surahNumber)
- TakesverseNumber
and returns audio URL of that versegetJuzURL(int juzNumber)
- TakesjuzNumber
and returns Juz URL (from Quran.com)getSurahURL(int surahNumber)
- TakessurahNumber
and returns Surah URL (from Quran.com)getVerseURL(int surahNumber, int verseNumber)
- TakessurahNumber
&verseNumber
and returns Verse URL (from Quran.com)
Search:
searchWords(List<String> words)
- Takes a list of wordswords
and returns a map containing no. of occurences and result of the word search in the arabic quran textsearchWordsInTranslation(List<String> words, {Translation translation})
- Takes a list of wordswords
andtranslation
(optional) and returns a map containing no. of occurences and result of the word search in the traslation
Translations:
- English (Saheeh International) -
Translation.enSaheeh
- English (Clear Quran) -
Translation.enClearQuran
- French (Muhammad Hamidullah) -
Translation.frHamidullah
- Turkish -
Translation.trSaheeh
- Malayalam (Cheriyamundam Abdul Hameed and Kunhi Mohammed Parappoor) -
Translation.mlAbdulHameed
- Farsi -
Translation.faHusseinDari
- Portuguese -
Translation.portuguese
- Italian -
Translation.itPiccardo
- Dutch -
Translation.nlSiregar
- Russian -
Translation.ruKuliev
- Bengali -
Translation.bengali
- Chinese -
Translation.chinese
- Swedish -
Translation.swedish
- Spanish -
Translation.spanish
- Urdu -
Translation.urdu
- Indonesian -
Translation.indonesian
Font Setup
It is recommended to use google_fonts package and use the following fonts for better Quranic text display:
- Amiri -
GoogleFonts.amiri()
- Amiri Quran -
GoogleFonts.amiriQuran()
Setup
Add the following dependencies in your pubspec.yaml
:
dependencies:
flutter:
sdk: flutter
google_fonts: ^2.1.0
quran: ^1.2.3
Usage Example
Setting font globally:
MaterialApp(
theme: ThemeData(
textTheme: GoogleFonts.amiriTextTheme(),
),
);
MaterialApp(
theme: ThemeData(
textTheme: GoogleFonts.amiriQuranTextTheme(),
),
);
For specific text:
Text(
quran.basmala,
style: GoogleFonts.amiri(),
),
Text(
quran.getVerse(18, 1),
style: GoogleFonts.amiriQuran(),
),
Example
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:quran/quran.dart' as quran;
void main() {
runApp(MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text("Quran Demo"),
),
body: SafeArea(
child: Padding(
padding: EdgeInsets.all(15.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Juz Number: \n" + quran.getJuzNumber(18, 1).toString()),
Text("\nJuz URL: \n" + quran.getJuzURL(15)),
Text("\nSurah and Verses in Juz 15: \n" + quran.getSurahAndVersesFromJuz(15).toString()),
Text("\nSurah Name: \n" + quran.getSurahName(18)),
Text("\nSurah Name (English): \n" + quran.getSurahNameEnglish(18)),
Text("\nSurah URL: \n" + quran.getSurahURL(18)),
Text("\nTotal Verses: \n" + quran.getVerseCount(18).toString()),
Text("\nPlace of Revelation: \n" + quran.getPlaceOfRevelation(18)),
Text(
"\nBasmala: \n${quran.basmala}",
style: GoogleFonts.amiriQuran(),
),
Text(
"\nVerse 1: \n${quran.getVerse(18, 1)}",
style: GoogleFonts.amiriQuran(),
),
],
),
),
),
),
));
}
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:quran/quran.dart' as quran;
void main() {
runApp(
MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text(quran.getSurahName(18)),
),
body: SafeArea(
child: Padding(
padding: EdgeInsets.all(15.0),
child: ListView.builder(
itemCount: quran.getVerseCount(18),
itemBuilder: (context, index) {
return ListTile(
title: Text(
quran.getVerse(18, index + 1, verseEndSymbol: true),
textAlign: TextAlign.right,
style: GoogleFonts.amiri(),
),
);
},
),
),
),
),
),
);
}
Libraries
- juz_data
- page_data
- quran
- quran_text
- sajdah_verses
- surah_data
- translations/bengali
- translations/chinese
- translations/en_clearquran
- translations/en_saheeh
- translations/fa_husseindari
- translations/fr_hamidullah
- translations/indonesian
- translations/it_piccardo
- translations/ml_abdulhameed
- translations/nl_siregar
- translations/portuguese
- translations/ru_kuliev
- translations/spanish
- translations/swedish
- translations/tr_saheeh
- translations/urdu