SearchResult class

Represents the result of a text search in the Quran.

Constructors

SearchResult.new({required String searchTerm, required int totalResults, required List<AyahWithSurah> results, String source = "Tanzil Project - https://tanzil.net"})
const
SearchResult.fromJson(Map<String, dynamic> json)
Creates a SearchResult from JSON data
factory

Properties

hashCode int
The hash code for this object.
no setteroverride
hasResults bool
Whether the search returned any results
no setter
isEmpty bool
Whether the search returned no results
no setter
results List<AyahWithSurah>
List of ayat that contain the search term
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchTerm String
The search term that was used
final
source String
Source attribution for the Quran text
final
statistics SearchStatistics
Get statistics about the search results
no setter
totalResults int
Total number of ayat that contain the search term
final

Methods

copyWith({String? searchTerm, int? totalResults, List<AyahWithSurah>? results, String? source}) SearchResult
Creates a copy of this SearchResult with the given fields replaced with new values
getResultsByRevelationType(String revelationType) List<AyahWithSurah>
Get results by revelation type
getResultsFromJuz(int juzNumber) List<AyahWithSurah>
Get results from specific Juz
getResultsFromSurah(int surahId) List<AyahWithSurah>
Get results from a specific surah only
groupByJuz() Map<int, List<AyahWithSurah>>
Group results by Juz
groupBySurah() Map<int, List<AyahWithSurah>>
Group results by surah
limitResults(int limit) List<AyahWithSurah>
Get results limited to a specific number
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts the SearchResult to JSON
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override