setTargetLanguage method

Future<void> setTargetLanguage(
  1. Language language
)

Persist a new target language in preferences.

Implementation

Future<void> setTargetLanguage(Language language) async {
  String localeTag = language.locale.toLanguageTag();
  await _preferences.put('target_language', localeTag);

  language.initialise();

  notifyListeners();
}