Open lakshmanaprabhu opened 4 years ago
You could use code like this:
Localizations.of<I18n>(context, WidgetsLocalizations).cancel == 'Cancel'
Thanks for the reply. In my case, I have multiple languages to choose from.
Why don't we add getter method for Locale in I18n.dart ? like,
static Locale get locale => _locale;
Seems, it helps me better. Thoughts?
Yeah, it could simplify my life to have this getter too
Team, Is that possible to fetch the current locale used in that app? (Particularly, while changing locale manually)
Tried to fetch the current locale,
Locale myLocale = Localizations.localeOf(context);
import 'dart:ui' as ui;
Locale myLocale = ui.window.locale;
But, both returns device locale. Actually, I want a locale from generated/I18n._locale.
is that possible?