changeLang function Null safety

void changeLang(
  1. BuildContext context,
  2. String newLocale
)

Implementation

void changeLang(BuildContext context, String newLocale) {
  context.setLocale(Locale(newLocale));
}