quran 0.0.9 quran: ^0.0.9 copied to clipboard
Full Quran text and aya, surah, place of revelation details etc.
Full Quran text and Surah details
Getting Started #
To use this plugin, add quran
as a dependency in your pubspec.yaml file.
Functions:
getSurahName(int surahNumber)
- Get Surah Name by surah numbergetSurahNameEnglish(int surahNumber)
- Get Surah English Title by surah numbergetAyaCount(int surahNumber)
- Get Aya Count by surah numbergetPlaceOfRevelation(int surahNumber)
- Get Place of Revelation (Makkah / Madinah)getVerse(int surahNumber, int verseNumber)
- Get Verse (text) by surah number and verse numbergetTotalAyaCount()
- Get total aya countgetTotalSurahCount()
- Get total surah count
Example #
import 'package:flutter/material.dart';
import 'package:quran/quran.dart';
void main(){
runApp(MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text("Quran Demo"),
),
body: SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Surah: ${getSurahName(1)}"),
Text("English title: ${getSurahNameEnglish(1)}"),
Text("Aya: ${getAyaCount(1)}"),
Text("Place of Revelation: ${getPlaceOfRevelation(1)}"),
Text("Verse 1: ${getVerse(1, 1)}")
],
),
),
),
));
}
import 'package:flutter/material.dart';
import 'package:quran/quran.dart';
void main() {
runApp(MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text("Quran Demo"),
),
body: SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Surah: ${getSurahName(1)}"),
Text("English title: ${getSurahNameEnglish(1)}"),
Text("Aya: ${getAyaCount(1)}"),
Text("Place of Revelation: ${getPlaceOfRevelation(1)}"),
Text("Verses: "),
Expanded(
child: ListView.builder(
itemCount: getAyaCount(1),
itemBuilder: (context, index) {
return Text("${index+1}. ${getVerse(1, index + 1)}");
},
),
),
],
),
),
),
));
}