getCurrentLanguage function

Future<String> getCurrentLanguage()

Implementation

Future<String> getCurrentLanguage() async {
  try {
    final locale = await _platform.getCurrentLanguage();

    if (locale == null) {
      throw Exception("Unable to get current language.");
    }

    return locale;
  } catch (error, stackTrace) {
      Error.throwWithStackTrace(error, stackTrace);
  }
}