dorar_hadith 0.4.0
dorar_hadith: ^0.4.0 copied to clipboard
A comprehensive Dart library for accessing Dorar.net hadith database. Search hadiths, get explanations (sharh), browse scholars, books, and narrators.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
0.4.0 #
New Features #
- Sharh search: Added
SharhService.search()andDorarClient.searchSharh()to search for all available sharh (explanations) matching a query, matching the Node.jsgetAllSharhUsingSiteDorarendpoint. - Hadith categories:
DetailedHadithnow includes thematic categories (التصنيف الموضوعي) parsed from Dorar.net search results via a newHadithCategorymodel. - Pagination metadata:
SearchMetadatanow exposescurrentPageCount,total,totalPages,hasNextPage, andhasPrevPagefor both API and site search endpoints. - Convenience methods: Added
getSimilarHadith(),getAlternateHadith(),getUsulHadith(),getSharhByText(), andsearchSharh()directly onDorarClientfor quicker access.
Fixes #
- Query serialization:
removeHtmlandspecialistare no longer sent upstream to Dorar.net, matching the Node.js middleware behavior that strips them before forwarding. - Grade fallback: When
gradeis empty butexplainGradehas a value, the parser now copiesexplainGradetograde, matching the Node.js fallback behavior. - JSON serialization: Fixed
toJson()on nested Freezed objects (ApiResponse,Sharh,DetailedHadith) to properly call.toJson()on child models viaexplicit_to_json: true.
Documentation #
- Updated README (EN/AR) with examples for sharh search, convenience methods, categories, and expanded pagination metadata.
0.3.1 #
- Fixed a bug with the cache system where the removeHtml parameter doesn't effect the cache
0.3.0 #
- New Feature: Implemented a persistent caching system using Drift (SQLite).
- Replaced the in-memory cache with a robust, persistent database (
cache.db). - Supports native platforms (Windows, Linux, macOS, Android, iOS) using
sqlite3. - Supports Web using
sqlite3.wasm(requiressqlite3.wasmanddrift_worker.dart.jsin web root).
- Replaced the in-memory cache with a robust, persistent database (
- Improvement: Enhanced
CacheServiceto handle complex objects and metadata efficiently. - Internal: Refactored database connection logic to support multiple databases (
rawi.dbandcache.db) seamlessly across platforms.
0.2.0 #
- Added the richer
DetailedHadith/ExplainedHadithlayers plus the unifiedhukmgetter so consumers no longer jugglegradevsexplainGradewhen printing verdicts. - Updated
DorarClient/HadithServicequick-search APIs to keep returning lightweightHadithrows while detailed/site endpoints now surface the fullDetailedHadithpayloads. - Switched
UsulHadithto wrap the newDetailedHadithso similar/alternate flags and sharh metadata are always available. - Introduced
DorarClient.use(...)for one-off scripts—resources are disposed automatically after the provided callback completes. - Refactored
Sharhto expose the embeddedExplainedHadith, giving direct access to takhrij, pass-through helpers, andSharh.textas an alias for the commentary body. - Bumped the minimum Dart SDK to 3.10.0 (and
httpto 1.6.0) to pick up the latest language/runtime fixes. - Moved asset-loader utilities under
src/utils/asset_loader/with explicit registration hooks so each platform can configure its loader cleanly. - Removed the deprecated
BookReference.popularBookshelpers to avoid stale curated lists. - Refreshed README (EN/AR) and dartdoc content to explain the new models and public API changes.
0.1.1 - 2025-11-11 #
- Small improvements
0.1.0 - 2025-11-10 #
- Initial public release of
dorar_hadith. - Hadith search via API and site (quick and detailed).
- Fetch hadith by ID, similar hadiths, alternate sahih, and usul (sources).
- Sharh (explanations) search and fetch by ID.
- Offline reference data services for books, scholars (mohdith), and narrators (rawi).
- Bundled SQLite database for narrators (rawi) with Drift ORM.
- Robust error handling with sealed
DorarExceptionhierarchy and helper messages. - Arabic search utilities (fuzzy match, diacritics stripping).
- Extensive unit, integration, and snapshot tests.
- Example app under
example/covering the main features.