useI18n function

void useI18n()

Implementation

void useI18n() {
  final context = useContext();
  final deviceLocale =
      Localizations.maybeLocaleOf(context) ?? const Locale('en');

  Future(() {
    if (context.mounted) {
      I18n.of(context).locale = deviceLocale;
    }
  }).ignore();
  return;
}