getAdhkar static method
Implementation
static dynamic getAdhkar({String adhkarId = ""}) {
try {
if (adhkarId.isNotEmpty) {
Adhkar response =
adhkarData.firstWhere((adhkar) => adhkar.id == adhkarId);
return response;
} else {
List<Adhkar> adhkars = [];
for (var i = 0; i < adhkarData.length; i++) {
adhkars.add(adhkarData[i]);
}
return adhkars;
}
} catch (error) {
throw Exception(error.toString());
}
}