tafsir_library 1.0.1 copy "tafsir_library: ^1.0.1" to clipboard
tafsir_library: ^1.0.1 copied to clipboard

A Flutter/Dart library for displaying and accessing Tafsir, Translations and Tajweed data with ready-made UI widgets and a direct API facade.

tafsir_library #

pub package pub points likes Pub Downloads License: MIT

Web Windows macOS Android iOS linux

A Flutter/Dart library for displaying and accessing Tafsir, Translations and Tajweed data with ready-made UI widgets and a direct API facade.

Features #

  • Ready UI widget for showing Tafsir with tabs (Tafsir + Translations + Tajweed).
  • Direct API access to Tafsir data, translations, and Tajweed info.
  • Built-in download management for tafsir/translation sources.
  • Custom tafsir sources support.
  • Arabic-friendly UI and styling options.

Installation #

Add to your pubspec.yaml:

dependencies:
    ...
	tafsir_library: ^1.0.1

Then run:

flutter pub get

Quick Start #

1) Initialize the library #

Future<void> main() async {
	WidgetsFlutterBinding.ensureInitialized();
	await TafsirLibrary.initialize();
	runApp(
      const MyApp(),
      );
}

2) Use the ready-made UI widget #

ShowTafsir(
	context: context,
	ayahUQNumber: 2,
	ayahNumber: 2,
	pageIndex: 1,
	isDark: false,
	surahNumber: 1,
)

3) Direct API usage (without ShowTafsir) #

await TafsirLibrary.fetchData();
final items = await TafsirLibrary.fetchTafsirAyah(ayahUQNumber);
final tafsirText = items.isNotEmpty ? items.first.tafsirText : '';

await TafsirLibrary.fetchTranslate();
final translation = TafsirLibrary.getTranslationText(surahNumber, ayahNumber);

TafsirLibrary.getTafsirFromCurrentTafsir(int ayahUQNumber);

UI Utilities #

Change Tafsir dialog #

TafsirLibrary.changeTafsirDialog(
	tafsirStyle: TafsirStyle.defaults(isDark: false, context: context),
	isDark: false,
	pageNumber: pageIndex + 1,
)

Font size dropdown #

TafsirLibrary.fontSizeDropdown(
	height: 30,
	isDark: false,
	tafsirStyle: TafsirStyle.defaults(isDark: false, context: context),
)

Tajweed #

final isAvailable = TafsirLibrary.isTajweedAvailable;
if (!isAvailable) {
	await TafsirLibrary.downloadTajweed();
}

final info = await TafsirLibrary.getTajweedAyahInfo(
	surahNumber: 1,
	ayahNumber: 2,
);

Sources #

License #

MIT

2
likes
160
points
129
downloads

Publisher

verified publisheralheekmahlib.com

Weekly Downloads

A Flutter/Dart library for displaying and accessing Tafsir, Translations and Tajweed data with ready-made UI widgets and a direct API facade.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

arabic_justified_text, archive, dio, flutter, get, get_storage, html, path, path_provider

More

Packages that depend on tafsir_library