quran_library 2.2.7 copy "quran_library: ^2.2.7" to clipboard
quran_library: ^2.2.7 copied to clipboard

retracted

An integrated package for displaying the Holy Qur’an identical to the Medina Quran with the narration of Hafs on the authority of Asim.

example/lib/main.dart

// import 'package:device_preview/device_preview.dart';
import 'dart:developer';

import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:quran_library/quran_library.dart';

Future<void> main() async {
  await WidgetsFlutterBinding.ensureInitialized();
  await QuranLibrary.init();
  runApp(
    // DevicePreview(
    //   builder: (context) => const MyApp(),
    // ),
    const MyApp(),
  );
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    const TextScaler fixedScaler = TextScaler.linear(1.0);
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      localizationsDelegates: const [
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate,
      ],
      supportedLocales: const [
        Locale('en'),
        Locale('ar'),
      ],
      locale: const Locale('ar'),
      // useInheritedMediaQuery: true,
      // locale: DevicePreview.locale(context),
      // builder: DevicePreview.appBuilder,
      theme: ThemeData(
        colorScheme: const ColorScheme.light(
          primary: Colors.teal,
        ),
        primaryColor: Colors.teal,
        useMaterial3: false,
      ),
      builder: (context, child) {
        final mq = MediaQuery.of(context);
        return MediaQuery(
          data: mq.copyWith(textScaler: fixedScaler),
          child: child!,
        );
      },
      home: const Scaffold(
        // body: SingleAyah(),
        // body: SingleSurah(),
        // body: QuranPages(),
        body: FullQuran(),
      ),
    );
  }
}

class FullQuran extends StatelessWidget {
  const FullQuran({
    super.key,
  });

  @override
  Widget build(BuildContext context) {
    return QuranLibraryScreen(
      parentContext: context,
      isDark: true,
      showAyahBookmarkedIcon: true,
      // appLanguageCode: 'ar',
      // ayahIconColor: Colors.teal,
      // backgroundColor: Colors.white,
      // textColor: Colors.black,
      isFontsLocal: false,
      // tafsirStyle:
      //     TafsirStyle.defaults(isDark: false, context: context).copyWith(
      //   widthOfBottomSheet: 500,
      //   heightOfBottomSheet: MediaQuery.sizeOf(context).height * 0.9,
      //   changeTafsirDialogHeight: MediaQuery.sizeOf(context).height * 0.9,
      //   changeTafsirDialogWidth: 400,
      // ),
      // anotherMenuChild:
      //     const Icon(Icons.play_arrow_outlined, size: 28, color: Colors.teal),
      // anotherMenuChildOnTap: (ayah) {
      //   // SurahAudioController.instance.state.currentAyahUnequeNumber =
      //   //     ayah.ayahUQNumber;
      //   AudioCtrl.instance
      //       .playAyah(context, ayah.ayahUQNumber, playSingleAyah: true);
      //   log('Another Menu Child Tapped: ${ayah.ayahUQNumber}');
      // },
      // secondMenuChild:
      //     const Icon(Icons.playlist_play, size: 28, color: Colors.teal),
      // secondMenuChildOnTap: (ayah) {
      //   // SurahAudioController.instance.state.currentAyahUnequeNumber =
      //   //     ayah.ayahUQNumber;
      //   AudioCtrl.instance
      //       .playAyah(context, ayah.ayahUQNumber, playSingleAyah: false);
      //   log('Second Menu Child Tapped: ${ayah.ayahUQNumber}');
      // },
    );
  }
}

class SingleSurah extends StatelessWidget {
  const SingleSurah({
    super.key,
  });

  @override
  Widget build(BuildContext context) {
    return SurahDisplayScreen(
      parentContext: context,
      surahNumber: 18,
      isDark: false,
      appLanguageCode: 'ar',
      useDefaultAppBar: false,
      anotherMenuChild:
          const Icon(Icons.play_arrow_outlined, size: 28, color: Colors.grey),
      anotherMenuChildOnTap: (ayah) {
        // SurahAudioController.instance.state.currentAyahUnequeNumber =
        //     ayah.ayahUQNumber;
        AudioCtrl.instance
            .playAyah(context, ayah.ayahUQNumber, playSingleAyah: true);
        log('Another Menu Child Tapped: ${ayah.ayahUQNumber}');
      },
      secondMenuChild:
          const Icon(Icons.playlist_play, size: 28, color: Colors.grey),
      secondMenuChildOnTap: (ayah) {
        // SurahAudioController.instance.state.currentAyahUnequeNumber =
        //     ayah.ayahUQNumber;
        AudioCtrl.instance
            .playAyah(context, ayah.ayahUQNumber, playSingleAyah: false);
        log('Second Menu Child Tapped: ${ayah.ayahUQNumber}');
      },
    );
  }
}

class SingleAyah extends StatelessWidget {
  const SingleAyah({
    super.key,
  });

  @override
  Widget build(BuildContext context) {
    return const Center(
      child: GetSingleAyah(
        surahNumber: 114,
        ayahNumber: 4,
        fontSize: 30,
        isBold: false,
      ),
    );
  }
}

class QuranPages extends StatelessWidget {
  const QuranPages({
    super.key,
  });

  @override
  Widget build(BuildContext context) {
    return Center(
      child: QuranPagesScreen(
        parentContext: context,
        enableMultiSelect: true,
        // highlightedAyahNumbersBySurah: {
        //   2: [7, 8, 9, 10, 11, 12],
        // },
        // page: 6,
        startPage: 6,
        endPage: 11, // النطاق شامل
        // highlightedAyahNumbersInPages: [
        //   (
        //     start: 3,
        //     end: 5,
        //     ayahs: [7, 8, 9, 10, 11, 12],
        //   )
        // ],
        highlightedRanges: const [
          (startSurah: 2, startAyah: 30, endSurah: 2, endAyah: 35)
        ],
        withPageView: true, // تمكين/تعطيل السحب بين الصفحات
        anotherMenuChild:
            const Icon(Icons.play_arrow_outlined, size: 28, color: Colors.teal),
        anotherMenuChildOnTap: (ayah) {
          // SurahAudioController.instance.state.currentAyahUnequeNumber =
          //     ayah.ayahUQNumber;
          AudioCtrl.instance
              .playAyah(context, ayah.ayahUQNumber, playSingleAyah: true);
          log('Another Menu Child Tapped: ${ayah.ayahUQNumber}');
        },
        secondMenuChild:
            const Icon(Icons.playlist_play, size: 28, color: Colors.teal),
        secondMenuChildOnTap: (ayah) {
          // SurahAudioController.instance.state.currentAyahUnequeNumber =
          //     ayah.ayahUQNumber;
          AudioCtrl.instance
              .playAyah(context, ayah.ayahUQNumber, playSingleAyah: false);
          log('Second Menu Child Tapped: ${ayah.ayahUQNumber}');
        },
      ),
    );
  }
}
56
likes
0
points
772
downloads

Publisher

verified publisheralheekmahlib.com

Weekly Downloads

An integrated package for displaying the Holy Qur’an identical to the Medina Quran with the narration of Hafs on the authority of Asim.

Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

archive, audio_service, connectivity_plus, dio, flutter, flutter_scale_kit, flutter_sliding_panel, flutter_svg, get, get_storage, html, just_audio, just_audio_media_kit, media_kit_libs_windows_audio, path, path_provider, rxdart

More

Packages that depend on quran_library

Packages that implement quran_library