getAllEditions function
? Edition Endpoints
Lists all available editions. You can filter the results using the parameters below.
format
- Specify a format. 'text' or 'audio'
language
- A 2 digit language code. Example: 'en
', 'fr
', etc.
type
- A valid type. Example - 'versebyverse', 'translation' etc.
Implementation
/// Lists all available editions. You can filter the results using the parameters below.
/// `format` - Specify a format. 'text' or 'audio'
/// `language` - A 2 digit language code. Example: '`en`', '`fr`', etc.
/// `type` - A valid type. Example - 'versebyverse', 'translation' etc.
Future<List<Edition>> getAllEditions({
String? format,
String? language,
String? type,
}) async {
final res = await get('/edition', query: {
if (format != null) 'format': format,
if (language != null) 'language': language,
if (type != null) 'type': type,
});
return (res['data'] as List).map<Edition>((e) => Edition.fromMap(e as Map<String, dynamic>)).toList();
}