setLanguage method
changes active language
Implementation
Future<void> setLanguage(
BuildContext context, {
required String language,
bool restart = true,
}) async {
_locale = Locale(language, "");
String filePath = "$_assetsDir$language.json";
_values = json.decode(await rootBundle.loadString(filePath));
if (restart) {
// ignore: use_build_context_synchronously
LocalizedApp.restart(context);
}
}