v3.2.0
timezone_to_country
用于将时区 ID 转换为 ISO 3166-1 alpha-2 国家代码的扩展方法(例如 'Asia/Seoul' 转换为 'KR')
11喜欢 6.4万近 30 天下载160Pub 分数
AndroidiOSLinuxmacOSWebWindows
用于将时区 ID 转换为 ISO 3166-1 alpha-2 代码的库(例如 'Asia/Seoul' 转换为 'KR')
{"sdk":"flutter"}^0.11.0^5.0.0{"sdk":"flutter"}以下为英文项目原文快照,最新内容请访问 GitHub。
pub package pub points pub downloads flutter ci
Library for translation Time Zone Id to ISO 3166-1 alpha-2 code (e.g. 'Asia/Seoul' to 'KR')
example
TimeZoneToCountry.getCountryCode('Asia/Seoul') // 'KR'
TimeZoneToCountry.getCountryCode('America/Los_Angeles') // 'US'
TimeZoneToCountry.getCountryCode('Europe/London') // 'GB'
String code = await TimeZoneToCountry.getLocalCountryCode();
print(code); // 'KR'
IANA - Time Zone Database - 2025c