changeLanguage method

dynamic changeLanguage(
  1. String language, {
  2. bool restartState = true,
})

Update the language in the application

Implementation

changeLanguage(String language, {bool restartState = true}) async {
  if (!mounted) return;
  await NyLocalization.instance.setLanguage(
    context,
    language: language,
    restart: restartState,
  );
}