I have my Iphone set to English (UK) and I am trying to get the UK part in my flutter ap by doing this.
final languageCode = Platform.localeName.split('_'); //prints en final countryCode = Platform.localeName.split('_'); //prints NL where I want UK
But my country code is alway NL which is my region. How can I get UK?
Its look like you want to access ISO Country Code
You can acces your device language country code with :
//Your device's all locales final List<Locale> systemLocales = WidgetsBinding.instance!.window.locales; //Your device's first(current) locale country code. String? isoCountryCode = systemLocales.first.countryCode;
Answered By – guccisekspir