fetchSupportedLanguages method
Gets all languages supported by the translation service.
Return The supported languages.
Throws A description of the exception. See ChatError.
Implementation
Future<List<ChatTranslateLanguage>> fetchSupportedLanguages() async {
Map result =
await ChatChannel.invokeMethod(ChatMethodKeys.fetchSupportLanguages);
try {
ChatError.hasErrorFromResult(result);
List<ChatTranslateLanguage> list = [];
result[ChatMethodKeys.fetchSupportLanguages]?.forEach((element) {
list.add(ChatTranslateLanguage.fromJson(element));
});
return list;
} on ChatError catch (e) {
throw e;
}
}