dash_flags
A package for displaying flags of countries and languages with a set of widgets and enums
A Flutter package for displaying Countries and Languages flags 🌍
{"sdk":"flutter"}^2.0.1{"sdk":"flutter"}^2.0.1^4.6.0English project snapshot. Visit GitHub for the latest content.
Platform
Pub Package
License: BSD-3-Clause
GitHub code size in bytes
Star on GitHub
GitHub Open Issues
GitHub Last Commit Date
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.
The package uses flags from TwEmoji Countries & Languages Flags by Twitter
Animated Example
This GIF is taken from the Example Project
Import the package:
import 'package:dash_flags/dash_flags.dart';
Display a flag of a country:
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
Country Code or Language Code as Strings, then you can use Country.fromCode(countryCode) or Language.fromCode(languageCode).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.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.Country Code or Language Code used with .fromCode(String) method, an unknown flag would be displayed./ in the name of the timezone is replaced with an underscore _.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_NeraTimezone contains plus + sign, then you will find it replaced _plus_, for example: Etc_GMT_plus_0, Etc_GMT_plus_1, and Etc_GMT_plus_10Timezone 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_SZTimezone as String and you want to get the corresponding Timezone enum member, then you can use .fromString() method.Timezone with its original name without the above changes, then use .fromString() method, for example: Timezone.fromString('Africa/Cairo')CountryFlag.network(...) 🌐Country or Language, such as, Country.autoDetect & Language.autoDetect 🕵🏻♂️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.
Blade Flags BannerI 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.
Made with contrib.rocks.