Skip to main content

circle_flags 7.0.0 copy "circle_flags: ^7.0.0" to clipboard
circle_flags: ^7.0.0 copied to clipboard

A collection of round flags

circle_flags #

A collection of circular country flags.

Demo #

to view all flags https://hatscripts.github.io/circle-flags/gallery

Usage #


// use a valid country code
CircleFlag('us');
CircleFlag('fr');
CircleFlag(Flag.US);

Preloading #

You might want to preload images for a smoother list scrolling experience:

CircleFlag.preload(['fr', 'us']);

// or await it to know when the flags are ready to be painted
await CircleFlag.preload(Flag.values);

Flags are read from the DefaultAssetBundle of the given context, or from rootBundle when there is none. To preload from a bundle of your own, pass it:

await CircleFlag.preload(['fr', 'us'], assetBundle: myAssetBundle);

Iso codes are case insensitive, 'us', 'US' and Flag.US all show the same flag.

Overwriting or adding custom flags #

Some users have expressed their need to change some flags due to political reasons, or stylistic reasons. You might also wish to add your own flags. To do so refer to this issue: https://github.com/cedvdb/phone_form_field/issues/222

Contributing & issues #

Bugs and feature requests go to https://github.com/cedvdb/flutter_circle_flags/issues, see CONTRIBUTING.md for how to set up the project, run the checks and release.

Flags live in assets/svg/, one <code>.svg file per flag; that directory is the source of truth and lib/src/flag.dart is generated from it. Never edit lib/src/flag.dart by hand, instead add or change the asset and run:

dart run tool/generate_flag.dart
41
likes
140
points
72.1k
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A collection of round flags

Repository (GitHub)
View/report issues
Contributing

Topics

#flags #country-flags #svg

License

MIT (license)

Dependencies

flutter, flutter_svg, material_ui

More

Packages that depend on circle_flags