How to get timezone, Language and County Id in flutter by the location of device in flutter?

后端 未结 7 753
长情又很酷
长情又很酷 2020-12-24 10:59

I am new to flutter, and I want to get Timezone, language, and county Id when I run my project on my device android or iOS. It should detect Timezone, language and country I

7条回答
  •  悲&欢浪女
    2020-12-24 11:19

    you can use

    import 'dart:io' show Platform;
    
    String languageCode = Platform.localeName.split('_')[0];
    String countryCode = Platform.localeName.split('_')[1];
    

提交回复
热议问题