Hello Everyone,
I would like to retrieve from my flutter/dart project, the current system lqnguage code, like. fr, en, ...
What I have tried:
I have tried the following:
Locale myLocale = Localizations.localeOf(context);
String lc = currentLanguageCode(myLocale);
print ("Language code: ${lc}");
The problen is from the
void initState() statement, the context is null and will then return an empty string.
I was hoping to have a method like:
Platform.isIOS
Does anyonce have an idea how to grab this language code from everywhere in the project.
Thank you very much in advance.
Best regards.
MiQi