dash_flags는 국가 및 언어의 깃발을 표시하기 위한 위젯과 열거형의 컬렉션을 제공하는 Flutter 패키지입니다. 플랫폼 간 일관되고 사전 정의된 깃발 표현을 제공함으로써 애플리케이션에 깃발 아이콘을 통합하는 것을 단순화합니다. 이 패키지는 Android, iOS, Web, macOS, Windows, Linux 등 여러 플랫폼을 지원하여 광범위한 호환성을 보장합니다. 개발자는 직관적인 열거형을 사용하여 깃발을 쉽게 선택하고 표시할 수 있으며, 로컬라이제이션, 사용자 인터페이스 향상 또는 지역 기반 기능에 이상적입니다.
사용 사례
사용자 프로필에 국가 깃발 표시
언어 선택 인터페이스 구현
로컬라이제이션 UI 향상
앱에서 지역 지표 표시
다국어 앱 인터페이스 만들기
주요 기능
사전 구축된 플래그 위젯
국가 및 언어 플래그 지원
플랫폼 독립적 설계
직관적인 열거형 기반 플래그 선택
경량이며 통합이 쉬움
적합한 대상
로컬라이제이션 기능
다국어 애플리케이션
사용자 프로필 사용자 정의
지역 기반 콘텐츠 필터링
시각적 신호를 통한 UI/UX 개선
고려 사항
사전 정의된 플래그 세트로 제한됨
사용자 지정 플래그 지원 없음
외부 플래그 자산에 종속
새로운 국가/언어 코드를 위한 업데이트가 필요할 수 있습니다
대규모 고성능 플래그 렌더링에 최적화되지 않음
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
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.