locale_emoji 0.1.3 locale_emoji: ^0.1.3 copied to clipboard
Convert Locale (i.e. language code, script code and country code) to flag emoji
example/locale_emoji_example.dart
import 'package:locale_emoji/locale_emoji.dart' as le;
void main() {
print('de outputs π©πͺ: ${le.getFlagEmoji('de')}');
print('en outputs πΊπΈ: ${le.getFlagEmoji('en')}');
print('EN outputs πΊπΈ: ${le.getFlagEmoji('EN')}');
print('pt outputs π§π·: ${le.getFlagEmoji('pt')}');
print('zh outputs π¨π³: ${le.getFlagEmoji('zh')}');
print('de-DE outputs π©πͺ: ${le.getFlagEmoji('de', countryCode: 'DE')}');
print('de-DE outputs π©πͺ: ${le.getFlagEmoji('de', countryCode: 'DE')}');
print('de-CH outputs π¨π: ${le.getFlagEmoji('de', countryCode: 'CH')}');
print('en-GB outputs π¬π§: ${le.getFlagEmoji('en', countryCode: 'GB')}');
print('en-US outputs πΊπΈ: ${le.getFlagEmoji('en', countryCode: 'US')}');
print('EN-US outputs πΊπΈ: ${le.getFlagEmoji('EN', countryCode: 'US')}');
print('EN-us outputs πΊπΈ: ${le.getFlagEmoji('EN', countryCode: 'us')}');
print('en-us outputs πΊπΈ: ${le.getFlagEmoji('en', countryCode: 'us')}');
print('zh-TW outputs πΉπΌ: ${le.getFlagEmoji('zh', countryCode: 'TW')}');
print('zh-tw outputs πΉπΌ: ${le.getFlagEmoji('zh', countryCode: 'tw')}');
print('zh-Bopo outputs πΉπΌ: ${le.getFlagEmoji('zh', scriptCode: 'Bopo')}');
print('zh-Hanb outputs πΉπΌ: ${le.getFlagEmoji('zh', scriptCode: 'Hanb')}');
print('zh-Hant outputs πΉπΌ: ${le.getFlagEmoji('zh', scriptCode: 'Hant')}');
print('zh-BOPO outputs πΉπΌ: ${le.getFlagEmoji('zh', scriptCode: 'BOPO')}');
print('zh-HANB outputs πΉπΌ: ${le.getFlagEmoji('zh', scriptCode: 'HANB')}');
print('zh-HANT outputs πΉπΌ: ${le.getFlagEmoji('zh', scriptCode: 'HANT')}');
print('eo outputs null: ${le.getFlagEmoji('eo')}');
print('rubbish outputs null: ${le.getFlagEmoji('rubbish')}');
print(
'sk-Latin-SK outputs πΈπ°: ${le.getFlagEmoji('sk', scriptCode: 'Latin', countryCode: 'SK')}',
);
}