dash_flags 0.0.2 copy "dash_flags: ^0.0.2" to clipboard
dash_flags: ^0.0.2 copied to clipboard

A package for displaying flags of countries and languages with a set of widgets and enums inspired by blade-flags package for Laravel by @MohmmedAshraf from Egypt.

Dash Flags Banner

Dash Flags

Platform Pub Package style: effective dart
Star on GitHub License: BSD-3-Clause GitHub code size in bytes


๐Ÿ’ก 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.

The package uses flags from TwEmoji Countries & Languages Flags by Twitter

Example GIF
This GIF is taken from the Example Project

๐Ÿ’ป Usage #

Import the package:

import 'package:dash_flags/dash_flags.dart';

Display a flag of a country:

CountryFlag(
  country: Country.eg, // You can also use Country.fromCode('eg')
  height: 50,
)

Display a flag of a language:

LanguageFlag(
  language: Language.ar, // You can also use Language.fromCode('ar')
  height: 50,
)

๐Ÿ“˜ You can checkout the complete API Reference here

๐Ÿ“ƒ Notes #

  • 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.

โœ… 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.

Blade Flags Banner

๐Ÿ’ช๐Ÿป 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.

Made with contrib.rocks.

66
likes
0
pub points
91%
popularity

Publisher

verified publishermoaz.dev

A package for displaying flags of countries and languages with a set of widgets and enums inspired by blade-flags package for Laravel by @MohmmedAshraf from Egypt.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_svg

More

Packages that depend on dash_flags