world_flags 2.9.1
world_flags: ^2.9.1 copied to clipboard
The first and only collection of declaratively defined world flags. No assets.
2.9.1 #
NEW FEATURES
- This version introduces named (Dart 3.10 dot-shorthand compatible) constructors for ISO classes, refactoring the ISO data files to use a factory constructor pattern with extension types. The changes transform the direct constructor calls into a more structured factory-based approach while maintaining backward compatibility. For example, instead of using
CountrySvk(), you can now useWorldCountry.svk(). This change enhances code readability and aligns with modern Dart practices.
const country = CountrySvk(); // Old way (still supported).
const country = WorldCountry.svk(); // New way, or just .svk() in Dart 3.10.
print([WorldCountry.svk(), WorldCountry.cze()]); // Collections, 3.9 way.
// You can also use the new dot-shorthand syntax introduced in Dart 3.10:
print(<WorldCountry>[.svk(), .cze()]); // Collections, 3.10 way.
CHORE
- Bulgarian
currenciesarray updated to reflect current usage of both BGN and EUR in Bulgaria.
2.9.0 #
NEW FEATURES
- Adds support for
XCG(Caribbean Guilder) andZWG(Zimbabwean Gold) currencies with translations (across 100+ locales each). - Deprecates
ANG,BGN, andZWLcurrencies with appropriate migration paths.
FIX
- Corrected Slovak country name for
CIVto "Pobrežie Slonoviny". - Corrected English currency name for
KGSto "Kyrgyzstani Som". - Corrected English currency name for
GYDto "Guyanese Dollar".
REFACTOR
- Marked
permissiveISO constructors and translation-related parameters as deprecated; deprecated a translation interface and related extension methods.
CHORE
- Enable and fix 10 new Dart Code Metrics rules (from the 1.32.0: October Update).
DOCUMENTATION
- Improved documentation in README.
2.8.0 #
NEW FEATURES
- Improve Norfolk Island (NF) flag.
REFACTOR
- Updated flag properties from
isSimplified: truetoisSimplified: nullacross multiple countries.
DOCUMENTATION
- Added website with flags demo (to
pubspec.yamlandREADME.md). - Enhanced documentation for
isSimplifiedproperty with detailed explanations.
2.7.0 #
NEW FEATURES
- Added Guernsey flag painter (
GgyPainter) and export, so GGY is no longer a "simplified" flag.
REFACTOR
- Made
Shapeimplementationsfinal; added deprecations for legacy helpers (to be replaced with modernswitchexpressions). - Selectively disable anti-aliasing for axis-aligned rectangles (e.g., BLR vertical line, SAU sabre) to avoid blur; keep AA for diagonals.
FIX
- Oman flag default aspect ratio corrected (from 2 to 7/4).
- Fixed white rectangle position in Belarusian flag (on smaller sizes).
CountryName's short flag (true) intoString()override returnscommonname, same way, as in parent's (TranslatedNameclass) override.
CHORE
- The Dart SDK was bumped to v3.9.2.
2.6.0 #
FIX
- Updated country data with recent population, Gini, and capital information.
- Fixed demonyms, borders, and native names for select countries.
- Corrected Welsh official country name for Curaçao.
- Corrected Korean localization for British Indian Ocean Territory, Dominica, Mongolia, Wallis and Futuna and South Georgia.
- Corrected
subunitToUnitvalue for Hungarian Forint.
NEW FEATURES
- Flag anti-aliasing is now smarter - it's defined on element painters level, so rectangle elements are no longer anti-aliased.
- Added
copyWithextension forIsoFlag, also exposed flag data mapsmapandalternativeMapvia public getters for easier access. - Added a new property
FlagElementsType? baseElementTypeto flag dataFlagPropertiesindicating the base geometric or symbolic element of each flag, enhancing metadata and classification. - Also added an
isSimplifiedproperty to flag definitions, allowing users to distinguish between simplified and fully detailed flags. - Updated language metadata to better reflect writing systems and script directionality for many languages.
REFACTOR
- Deprecated ineffective anti-aliasing override
flagAntiAliasOverrideproperties and improved anti-aliasing handling in flag rendering. - Optimized flag painting performance for stripes and stars, reducing redundant object creation and improving rendering efficiency.
- Deprecated
fullFlagslist in favor of newisSimplifiedproperty. - Marked certain currencies as deprecated and updated related comments.
- Corrected country and language associations in documentation for currencies and languages.
- Standardized code normalization using new ISO code extension types, replacing older string and object extension methods.
- Deprecated legacy constant lists in favor of centralized static lists for ISO classes.
- Deprecated functional-style pattern matching methods and boolean type-check getters across ISO/sealed models. Users are advised to use switch expressions or direct equality/type checks instead.
- Deprecated extensions providing
is*getters in favor of direct type checks. - Standardized method return types for map serialization to use stronger, standard Dart Map types.
- Simplified code by removing redundant comments and improving null-aware syntax usage.
CHORE
- The Dart SDK was bumped to v3.8.1.
- Refined static analysis and linting rules, including enabling and disabling specific Dart Code Metrics rules.
DOCUMENTATION
- Improved code and API documentation for clarity and accuracy.
- Improved formatting, fixed typos, and updated usage examples in README.
TEST
- Improved test handling for platform-specific golden image comparisons by skipping only the assertion step on unsupported platforms.
- Removed outdated test files related to deprecated APIs.
- Added or updated test cases to cover new behaviors and deprecation handling.
2.5.0 #
FIX
- Adjust height and width factors for Afghanistan flag properties and update
ShahadaPaintertranslation logic.
NEW FEATURES
- Added new flag definitions for international and constructed languages (e.g., European Union, Esperanto, Ido, Interlingue, Interlingua, Volapük).
- Introduce
IsoFlagwidget andDecoratedFlagWidgetbase class. - Unified flag widget interfaces to support foreground child widgets, explicit sizing, and improved decoration options.
- Added
heightandwidthparameters to theBasicFlag. - Added new collections and extensions for mapping currencies and languages to countries (via
byCountryMapmethod), including support for unofficial and constructed languages. - Introduced methods to prioritize and customize country associations for languages and currencies.
- Improved diagnostics and theming for flag widgets, including support for custom overlay widgets.
- Added new extension methods and interfaces for easier flag and country data access.
CHORE
- The Dart SDK was bumped to v3.8.1.
- Deprecated outdated Afghanistan flag and updated references to its alternative.
- Deprecated
foregroundWidgetparameter in flag widgets, in favor ofchildone. - Update German and English translations (for multiple countries).
- Updated official
languageslists for Ethiopia and Iraq to reflect additional recognized languages.
2.4.1 #
CHORE
- Flag of Syria update.
2.4.0 #
NEW FEATURES
- Improve Iraq flag painer aspect ratio change handling.
- Enhance ISO standardized classes with
Comparableinterface and update bool getters. - Add regional code alias and new ISO standardized extensions for type checking.
- Add official country translations for the Indonesian language.
CHORE
- The Dart SDK was bumped to v3.8.0.
- Code has been formatted with the new Dart formatter.
- Correct latitude values for several countries.
- Update currency for South Georgia to GBP.
- Update symbol for Sudanese pound to "ج.س".
REFACTOR
- Make copy-with extensions generic for ISO standardized classes.
DOCUMENTATION
- Improved documentation in README.
- Update dartdoc in ISO standardized classes instances to use backticks.
TEST
- Add tests for comparable boolean getters in ISO standardized classes.
- Add unit tests for regional code and ISO standardized extensions.
2.3.0 #
NEW FEATURES
- Added the
regionalCodegetter to theBasicTypedLocaleto provide a convenient alias for thecountryCodeproperty, improving consistency when working with regional locales.
DOCUMENTATION
- Update dartdoc documentation for countries to use backticks for ISO code formatting.
REFACTOR
- Replaced text-based flag rendering with vector path drawing for Iraq, Afghanistan, Saudi Arabia and U.S. Virgin Islands flags, improving rendering consistency on all platforms.
- Deprecated
flagTextStyleOverridegetter and setter (visible for testing) as text-based painters were removed.
2.2.0 #
This is maintenance release without significant changes for the users, that aims to improve DevEx when working with flags in DevTools.
NEW FEATURES
- To enhance debugging, all widgets within this package now override
debugFillProperties, providing detailed flag property information, including values and rationales. Crucially, this allows you to visualize emoji flags directly in dev tools, replacing generic widget names.
CHORE
- Dart SDK bumped to v3.7.0.
- Code has been formatted with the new Dart formatter.
- Example app runners update.
2.1.0 #
REFACTOR
- Nullable
maybeCommonNameFormethod now accepts nullablemainLocaleparameter - ifnullis provided,nullwill be returned.
2.0.1 #
REFACTOR
- Improved generics handling in localization methods.
- Update and use stable L10N packages.
DOCUMENTATION
- Improved documentation and example.
- Fixed typos in the README.
2.0.0 #
🎉 Second anniversary and new major release!
NEW FEATURES
- Introduced new methods for working with common names and common name maps:
commonNamesMapon ISO collections andcommonNameFor/maybeCommonNameForon ISO objects. These methods are significantly faster than the oldtranslations- related methods because they work directly with locale-specific maps instead of iterating through all translations of each ISO object. - The
translationsgetter is now a computed field. This means it will only generate the translations when they are requested, rather than storing them all in memory. It's recommended to cache the results of the getter to avoid redundant calculations. Because of that -translationandmaybeTranslationmethods are no longer recommended for retrieving localization data. - The
commonNamesCacheMapis deprecated because it relies on the memory-intensivetranslationsgetter. - New localization delegates on
IsoTranslatedobjects simplify complex queries for object localizations. - Bool getters on
IsoStandardizedobjects can now be applied to null values. For example,maybeIso.isRuswill returnfalseifmaybeIsois null, without the need for additional null-checks.
FIX
- Replaced deprecated
Colormethods.withOpacitywith new.withAlpha - Changed official name for Portugal: "República português" > "República Portuguesa".
- Change the capital of Indonesia for Nusantara: "Jakarta" > "Nusantara".
BREAKING CHANGES
- The package now requires Flutter v3.27.1 or higher.
- The
IsoTranslated<T, N, L>class now uses three generic types instead of two. If you used this class directly in your code, simply add the additional generic<L extends BasicLocale>to your reference. - The default
toString()implementation ofBasicLocalenow uses Flutter'sLocale-like output format. You can still access the old output by setting theshortflag tofalse. - The
sealed_country_translationslibrary is removed. Migrate to the l10n_countries package or usel10ngetter in ISO objects that provides the same data without holding all translations in memory. This sub-library and its content (except for supported locales lists - they will be moved to the main library) will be removed in the next major package version. - Country translation methods requires
BasicTypedLocaleinstead ofBasicLocale, if you didn't used country value - this change will not affect you, otherwise please change from:
BasicLocale(*, countryCode: "US");
to:
BasicTypedLocale(*, regionalCode: "US"); // or BasicTypedLocale(*, country: CountryUsa());
1.1.1 #
NEW FEATURES
- Updated the postal code pattern format for Paraguay.
- Updated International Olympic Committee (IOC) country code for Bahrain.
- Improvements of
toString()method implementations in models and addressing new lints + DCM reports. - Added "polski" to the Polish language's
namesNativearray.
1.1.0 #
NEW FEATURES
- Added
FlagExtensiononWorldCountryto provide flag-related properties and colors:flagStripeColors: Retrieves the stripe colors of the flag fromFlagProperties.flagElementsColors: Retrieves the element colors of the flag fromFlagProperties.flagColors: CombinesflagStripeColorsandflagElementsColorsinto a single list of colors.flagProperties: Retrieves theFlagPropertiesassociated with country (from the defaultWorldCountry.list).
1.0.0 #
🎉 First stable release!
NEW FEATURES
CountryFlagnow offersalternativeMapparameter that you can use to provide alternative look of the country flag. By default it contains updated Afghanistan flag (with official design from year 2021) and alternative French Guiana flags.
REFACTOR
- New asserts in the constructors and optimizations in several country flag painters.
TESTS
- Added tests for new asserts and update goldens with arabic fonts.
0.8.0 #
NEW FEATURES
CountryFlagnow have non-required child property.
DOCUMENTATION
- Fully document all the public members of the package.
0.7.0 #
TESTS
- Added unit, widget and golden tests for the package with code coverage around 100%.
- Small refactoring related to the linter rules.
0.6.0 #
NEW FEATURES
- Two new properties in the
FlagThemeData- width and height. Those will be also used in theCountryFlagand in aspect ratio calculation (if noaspectRatiois provided) if specified.
0.5.0 #
NEW FEATURES
- Updated README and example.
- Updated some simplified world country flags and also a
fullFlagslist.
New full flags:
- North Macedonia (MKD)
- Barbados (BRB)
- Eritrea (ERI)
- Slovakia (SVK)
- Tajikistan (TJK)
Updated simplified flags:
- Brazil (BRA)
- Malta (MLT)
- Albania (ALB)
- Belarus (BLR)
- Spain (ESP)
- Croatia (HRV)
- Iran (IRN)
- Kenya (KEN)
- Cambodia (KHM)
- Lebanon (LBN)
- Liechtenstein (LIE)
- Lesotho (LSO)
- Montenegro (MNE)
- Portugal (PRT)
- San Marino (SMR)
- Serbia (SRB)
- Slovenia (SVN)
- Turkmenistan (TKM)
- Uganda (UGA)
- Vatican City (VAT)
- Vanuatu (VUT)
- Zambia (ZMB)
0.1.0 #
NEW FEATURES
- Provided all 250 small and simplified world country flags, but at the same time 2/3 of these flags can be used as full-dimensional flags (
fullFlagslist).
0.0.1 #
NEW FEATURES
- Provided 225 out of all 250 small and simplified world country flags.
0.0.0 #
- Initial release.
