getLanguages method

  1. @override
Future<List<String>> getLanguages()
override

Return list of supported language code (i.e en-US) SpeechSynthesis Web API doesn't provide specific function to get supported language We get it from getVoice function instead

Implementation

@override
Future<List<String>> getLanguages() {
  List<String> voices = _getVoicesLang();

  /// Prevent convert to Set first to avoid duplication and convert back to list
  return Future.value(voices.toSet().toList());
}