# circle_flags 7.0.0

A collection of round flags




## Installing
```
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add 'circle_flags:7.0.0'
```
Published: 2026-10-04T12:29:45.043129Z
Expected archive SHA-256: aa4adae6565cecfc9fbfcb1336bcbabce718c0b0799d4b1bae7ad7e94ad05b75

Available in cache; verification: upstream_checksum
## Direct dependencies
- flutter: map[sdk:flutter]
- flutter_svg: ^2.3.0
- material_ui: ^1.4.0

## Package README (untrusted upstream documentation)
# circle_flags

A collection of circular country flags. 

## Demo

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

<img src="https://hatscripts.github.io/circle-flags/flags/br.svg" width="48">
<img src="https://hatscripts.github.io/circle-flags/flags/cn.svg" width="48">
<img src="https://hatscripts.github.io/circle-flags/flags/gb.svg" width="48">
<img src="https://hatscripts.github.io/circle-flags/flags/id.svg" width="48">
<img src="https://hatscripts.github.io/circle-flags/flags/in.svg" width="48">
<img src="https://hatscripts.github.io/circle-flags/flags/ng.svg" width="48">
<img src="https://hatscripts.github.io/circle-flags/flags/ru.svg" width="48">
<img src="https://hatscripts.github.io/circle-flags/flags/us.svg" width="48">

## Usage

```dart

// 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:

```dart
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:

```dart
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](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:

```bash
dart run tool/generate_flag.dart
```

## Changelog
## [7.0.0]
* [Breaking] removed the public `CircleFlag.cache` field, preloading goes through
  `CircleFlag.preload` instead. `CircleFlag.preload` is now typed `Future<void>`
  (it was untyped) and accepts an optional `context`/`assetBundle` to preload
  from another asset bundle
* iso codes are now case insensitive, `CircleFlag('US')` shows the same flag as
  `CircleFlag('us')` and `CircleFlag.preload(['US'])` preloads that same flag
* added `excludeFromSemantics` and `semanticsLabel` options
* the "?" fallback of unknown flags no longer relies on `Future.catchError`,
  which never completes inside the fake async zone of widget tests
* a flag is cached under a package namespaced svg cache key, so the decoded flag
  can not collide with the svg cache key of another loader
* added analysis_options.yaml and extended the test suite
* moved the flag generator to `tool/generate_flag.dart` (pub layout convention)
* the flag generator now refuses flag file names that can not be exposed as a
  `Flag` constant, see CONTRIBUTING.md
* added CONTRIBUTING.md, it documents how flags are added and regenerated
* the `assets/svg_hatscripts` working copy is no longer published, see
  `assets/.pubignore`
* removed the unused `build_runner` dev dependency

## [6.0.0]
* upgrade to material_ui

## [5.0.1]
* Fix for build runner issue

## [5.0.0]
* Use latest files from hatscripts
* Remove unnecessary files 
* Add note in readme on how to add your own flags
* [Breaking] renamed Flags in Flag

## [4.0.2]
* Exclude from semantics

## [4.0.1]
* Accept iterable in preloading method

## [4.0.0]
* [Breaking] Use `CircleFlag.preload([isoCode])` to preload a flag. FlagCache is no longer exported. 

## [3.0.1]
* made it easier to use cache, some breaking changes to just introduced cache api
  (doesn't warrant upgrade due to it just being introduced)

## [3.0.0]

* unknown flags display "?"
* revert to assets with preloading mechanism
* allow usage of other asset bundles

## [2.0.9]
* recreate loader when iso code changes

## [2.0.8]
* Change just introduced caching api

## [2.0.7]
* Fix issue with network flags not correctly loaded
* improve caching

## [2.0.0]

* use network image to reduce size
* added ability to preload images

## [1.0.4]

* increase `package:flutter_svg` version
* fix redering issue on some platforms

## [1.0.3]

* (Re)-added netherlands antilla's flag

## [1.0.2]

* add clipOval around flag for better rendering of svgs on the web

## [1.0.1]

* use sensible defaults for svgs placeholders

## [1.0.0]

* use svg for smaller memory footprint

## [0.0.3]

* added 3 missing flags

## [0.0.2]

* fix casing problems in country code

## [0.0.1] - 22/03/2021

* initial release







 
