alquran_cloud 0.0.1 copy "alquran_cloud: ^0.0.1" to clipboard
alquran_cloud: ^0.0.1 copied to clipboard

un-official dart client wrapper for the quran.cloud api consume the holy book of quran

example/main.dart

import 'package:alquran_cloud/alquran_cloud.dart' as quran_cloud;

Future<void> main(List<String> args) async {
  /// to enable logs (disabled by default)
  quran_cloud.quranCloud.enableLogs = true;

  /// use edition identifer to determine which edition of the quran to get
  final allEditions = await quran_cloud.getAllEditions();

  /// also you can query the edition you want
  final editionsQuery = await quran_cloud.getAllEditions(
    format: 'text', // or `audio`
    language: 'ar', // use .getEditionSupportedLanguages(); to get the all available languages
    type: 'quran', // user .getEditionTypes() to get all available types
  );

  final quran = await quran_cloud.getQuranByEdition(allEditions.first);

  /// get surah by number and edition
  final surah = await quran_cloud.getSurahByEdition(1, editionsQuery.first);

  /// get aya by number and edition
  final aya = await quran_cloud.getAyaByNumber(2, editionsQuery.first);

  print(aya.text); // الْحَمْدُ لِلَّهِ رَبِّ الْعَالَمِينَ
}
28
likes
120
pub points
34%
popularity

Publisher

unverified uploader

un-official dart client wrapper for the quran.cloud api consume the holy book of quran

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

dio, equatable, pretty_dio_logger

More

Packages that depend on alquran_cloud