Orientação gerada a partir de informações públicas. Apenas para referência.
dash_flags é um pacote Flutter que oferece uma coleção de widgets e enums para exibir bandeiras de países e idiomas. Ele simplifica a integração de ícones de bandeiras em aplicativos ao fornecer representações de bandeiras pré-definidas e consistentes entre plataformas. O pacote suporta múltiplas plataformas, incluindo Android, iOS, Web, macOS, Windows e Linux, garantindo ampla compatibilidade. Os desenvolvedores podem selecionar e exibir bandeiras facilmente usando enums intuitivos, tornando-o ideal para localização, melhorias na interface do usuário ou funcionalidades baseadas em região.
Casos de uso
Exibindo bandeiras de países nos perfis de usuários
Implementando interfaces de seleção de idioma
Melhorando interfaces de localização
Mostrando indicadores regionais nos aplicativos
Criando interfaces de aplicativos multilíngues
Principais recursos
widgets de bandeira pré-construídos
Suporte para bandeiras de país e idioma
Design independente de plataforma
Seleção intuitiva de sinalizadores baseada em enumeração
Leve e fácil de integrar
Indicado para
Recursos de localização
Aplicações multilíngues
Personalização do perfil do usuário
Filtragem de conteúdo baseada em região
Melhoria de UI/UX com pistas visuais
Considerações
Limitado ao conjunto de flags predefinido
Sem suporte a bandeiras personalizadas
Dependente de ativos externos de sinalização
Pode exigir atualizações para novos códigos de país/idio
Não otimizado para renderização de bandeiras de alto desempenho em escala
README original
Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.
Dash Flags
💡 Overview
A Flutter package for displaying Countries and Languages flags 🌍
This package provides a set of widgets and enums to display flags of countries and languages inspired by blade-flags package for Laravel by Mohamed Ashraf from Egypt.
CountryFlag(
country: Country.eg, // OR Country.fromCode('eg')
height: 50,
)
Display a flag of a language:
LanguageFlag(
language: Language.ar, // OR Language.fromCode('ar')
height: 50,
)
Display a flag of a timezone:
TimezoneFlag(
timezone: Timezone.africa_cairo, // OR Timezone.fromString('Africa/Cairo')
height: 50,
)
📘 You can checkout the complete API Reference here
📃 Notes
Countries & Languages Codes:
If you have the Country Code or Language Code as Strings, then you can use Country.fromCode(countryCode) or Language.fromCode(languageCode).
If the the Country Code or Language Code consists of more than one part, then you will find it separated by an underscore, for example: sh_ac and en_au.
If the the Country Code or Language Code is a reserved keyword in Dart, then you will find it prefixed with c_ or l_ respectively, for example: c_as and l_as.
If an unknown Country Code or Language Code used with .fromCode(String) method, an unknown flag would be displayed.
Timezones Codes:
The forward slash sign / in the name of the timezone is replaced with an underscore _.
If the Timezone contains minus - sign, then you will find it replaced with _minus_, for example: US_East_minus_Indiana, US_Indiana_minus_Starke, and Asia_Ust_minus_Nera
If the Timezone contains plus + sign, then you will find it replaced _plus_, for example: Etc_GMT_plus_0, Etc_GMT_plus_1, and Etc_GMT_plus_10
If the Timezone is associated with more than one country, then you will find a default enum member for it and other enum members for each country, for example: Africa_Johannesburg, Africa_Johannesburg_ZA, Africa_Johannesburg_LS, and Africa_Johannesburg_SZ
If you have the Timezone as String and you want to get the corresponding Timezone enum member, then you can use .fromString() method.
If you want to use the Timezone with its original name without the above changes, then use .fromString() method, for example: Timezone.fromString('Africa/Cairo')
✅ Roadmap
[ ] Add Tests 🧪
[ ] Add a simple way to use the raw svg assets 🎨
[ ] Make an online Gallery with all the available flags 📘
[ ] Add the ability to use the flags from the internet, such as, CountryFlag.network(...) 🌐
[ ] Add the ability to automatically detect the current Country or Language, such as, Country.autoDetect & Language.autoDetect 🕵🏻♂️
💖 Laravel Version
If you are looking for a Laravel Version of this package, check blade-flags, the original parent package of this library which that provides a set of flags for all countries and languages by Mohamed Ashraf from Egypt.
💪🏻 Contribution Guide
I would be happy to have your contributions 💙
If you find a bug or want a feature, but don't know how to fix/implement it, please fill an Issue.
If you fixed a bug or implemented a feature, please send a Pull Request.