I want to change the language of my flutter application by retrieving the default language of the phones set in the preferences. How to do ?
I want to change the language of my flutter application by retrieving the default language of the phones set in the preferences. How to do ?
3
Answers
In
MaterialApp
you can set application language withlocal
property,local property by default is system language
if you don’t set a custom local, app will use system language if this language is available in your app
Yes you can retreive that on the start of the application using localeResolutionCallback in the MaterialApp
Yes, you may use
Platform.localeName
fromdart:io
to get the name of the current device locale.