world_countries 3.9.4
world_countries: ^3.9.4 copied to clipboard
Sealed world data in form of Flutter widgets (country, phone, currency pickers, etc.).
3.9.4 #
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.
DOCUMENTATION
- Added benchmarks & regression verification documentation.
3.9.3 #
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.
3.9.2 #
NEW FEATURES
MaybeWidgetgains a new optionalbuildWhenpredicate parameter (all constructors) allowing additional conditional logic beyond simple null checks. When provided and returnsfalse, the widget (or list / nullable result) is skipped and the fallback (orElse/ empty list /null) is used.- New static factory
MaybeWidget.orNull- builds and returns a widget only when the provided value is non-null(and an optionalbuildWhenpredicate, if supplied, returnstrue); otherwise it returnsnull(instead of inserting an empty placeholder). This is ideal for concise conditional inclusion in collection literals or nullable child parameters. - Improve Norfolk Island (NF) flag.
- Added
isZerogetter onnum?(in helpers library). - Added nullable
maybeScaffoldandmaybeMessengergetters (in extensions onBuildContext, helpers library).
REFACTOR
- Adjust title alignment in default
searchSuggestionsbuilder (with newListTileparameters, provided in Flutter SDK v3.35.4). - Multiple improvements in metadata - including
@useResult(and other) annotations and updated interfaces. - Added assert statements to
copyWithmethods for validation. - Updated flag properties from
isSimplified: truetoisSimplified: nullacross multiple countries.
DOCUMENTATION
- Improve example/demo web. Revamped Settings page with Material 3, sliver app bar, toolbar with reset, and a scaled flag preview. Added new controls for aspect ratio, border (radius, width, color) and shadow (spread, blur, opacity, offsets).
- Added demo website to
homepageinpubspec.yaml. - Enhanced documentation for flag's
isSimplifiedproperty with detailed explanations.
3.9.0 #
NEW FEATURES
- List tiles support Material state controllers.
- Text fields gain select-all-on-focus and locale-specific hint options.
- Added Guernsey flag painter (
GgyPainter) and export, so GGY is no longer a "simplified" flag.
REFACTOR
- Deprecated static method
TypedLocaleDelegate.maybeOf(context)in favor ofTypedLocaleDelegate.of(context). - 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
- Corrected the dense
CountryTiletitle alignment so it centers with the flag. - 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.
DOCUMENTATION
- Improved example app and demo website (with Settings menu).
3.8.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
- Added platform dispatcher extension for convenient access to country, language, and script information from platform locales.
- 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.
- 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.
- Corrected country and language associations in documentation for currencies and languages.
- 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.
3.7.0 #
FIX
- Adjust height and width factors for Afghanistan flag properties and update
ShahadaPaintertranslation logic.
NEW FEATURES
- Introduced adaptive flag selection for language and currency pickers (via
.adaptiveFlagconstructor), automatically displaying the most relevant flag based on locale or user context. For example - they automatically show the most relevant flag based on the user's device locale, like showing the Austrian flag 🇦🇹 for the German language if the user is in Austria. - All pickers now support customizable flag maps and adaptive flag logic for enhanced visual customization (via
flagsMapparameter). ClearButtonnow extendsIconButtonso it supports all its super parameters, plus several params from theAnimatedCrossFadewidget.- 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.
- The
metapackage has been added as an explicit dependency, but it has the same version constraints as the current stable Flutter SDK version (3.32.4). - 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.
3.6.0 #
NEW FEATURES
- Add additional
ListTilesuper parameters to theListItemTilewidget. - Introduce
spacingand new Flutter 3.32.0 parameters (inshow*methods) in pickers. - Add extension for enhanced functionality of
ListItemTile. - Enhance ISO standardized classes with
Comparableinterface and update bool getters. - Add regional code alias and new ISO standardized extensions for type checking.
- Add formatter callback to localization packages for custom translation logic.
- 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.
- Flag of Syria update.
- Update symbol for Sudanese pound to "ج.س".
- Correct latitude values for several countries.
- Update currency for South Georgia to GBP.
REFACTOR
- Make copy-with extensions generic for ISO standardized classes.
- Improve
ListItemTilestructure for direct item property access.
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.
- Add unit tests for
ListItemTileextension functionality.
3.5.0 #
NEW FEATURES
- Added support for custom search result building in all pickers and searchable widgets via a new
onSearchResultsBuilderparameter, enabling advanced search algorithms like fuzzy search. - Introduced customizable localization formatting for ISO translations with a new L10N formatter callback. Kudos to @MaxLap.
- 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.
- Enhanced documentation with new FAQ sections and detailed examples on customizing search and localization.
REFACTOR
- Search performance has been significantly improved in pickers (that feature a search bar) and the search delegate, by implementing search map caching.
- 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.
TESTS
- Updated goldens for Iraq, Afghanistan, Saudi Arabia and U.S. Virgin Islands flags.
- Expanded test coverage for custom search algorithms and localization formatting features.
3.4.0 #
This is a DevEx release without significant changes for the users, that aims to improve developer experience when working with flags in DevTools.
NEW FEATURES
- To enhance debugging, widgets like
CountryFlag,BasicFlag,MaybeWidget, etc. now overridedebugFillProperties, providing detailed information, including values and rationales. Crucially, this allows you to visualize emoji flags directly in dev tools, replacing generic widget names.
CHORE
- Example app runners update.
3.3.0 #
DOCUMENTATION
- Highlight importance of
TypedLocaleDelegateusage in app'slocalizationsDelegates, for pickers L10N and improved search functionality. Thanks @wildsurfer!
REFACTOR
- Enhanced translation fallback mechanism in pickers. Previously, translations would only use the first available locale. Now, the system tries multiple sources in sequence:
- Direct
translationprovided to the picker. - Theme-level
translationfromPickersThemeData. - Global app translation from localizationsDelegates via
TypedLocaleDelegate.
- Direct
- Added assertion messages to help developers identify missing translations more easily.
- Improved translation debugging through more descriptive error messages.
3.2.0 #
This is maintenance release without significant changes for the users, that aims to fix dropped pub score after Flutter v3.29.0.
CHORE
- Dart SDK bumped to v3.7.0.
- Code has been formatted with the new Dart formatter.
- Deprecated
scribbleEnabledis replaced withstylusHandwritingEnabledparameter inAdaptiveSearchTextField.
3.1.0 #
NEW FEATURES
- Added two new
offstageconstructor and staticlistmethod, toMaybeWidget.MaybeWidget.offstage- Preserves layout space but hides the widget if the providedvalueisnull. Ideal if you want to conditionally toggle visibility without removing the widget from the tree.MaybeWidget.list- Builds either a single widget or multiple widgets ifvalueis notnull, or returns an empty list if it isnull. Gives you a flexible way to handle conditional UI blocks or spread-like usage in theFlexwidgets.
REFACTOR
- Nullable
maybeCommonNameFormethod now accepts nullablemainLocaleparameter - ifnullis provided,nullwill be returned.
3.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.
REFACTOR
- Improved generics handling in localization methods.
- Update and use stable L10N packages.
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. BasicPicker,BaseTileThemeDataandBaseTileThemeDataare now inherited fromIsoTranslatedinstead ofTranslatedclass.IsoLocaleis now deprecated in favor ofTypedLocalethat now implementsBasicTypedLocaleinstead ofBasicLocale.- Generic and
basekeyword onTypedLocaleclass are removed, you can still use newregionalCodeparameter to provide non-typed region/country info there. - 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. - From now on, you will most likely need to explicitly provide a
localizationsDelegates: const [TypedLocaleDelegate()],to your app, for pickers L10N and improved search. - Country translation methods requires
BasicTypedLocaleinstead ofBasicLocale, if you didn't used country value - this change will not affect you, same applies toTypedLocale. If you provided non-typed country data there - please change from:
BasicLocale(*, countryCode: "US");
// or
TypedLocale(*, country: "US");
to:
BasicTypedLocale(*, regionalCode: "US"); // or BasicTypedLocale(*, country: CountryUsa());
// or
TypedLocale(*, regionalCode: "US"); // or TypedLocale(*, country: CountryUsa());
2.0.2 #
NEW FEATURES
- Added new method for the FunctionalPlatform -
maybeWhen(in addition to hash-map like methodmaybeWhenConstthat works with mostly immutable object returns (instead of closures in the new method)). - Improved
showInSearchmethod pop handling. - A
searchSuggestionsmethod might be affected by the SDK bug fixed in v3.27.0. As a temporary workaround, you can create your own instance ofSearchControllerand dispose of it manually. - 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.
2.0.1 #
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).
2.0.0 #
BREAKING CHANGES
- Package requires Flutter version 3.19+, because it now uses Semantics identifier property in all picker's tiles (this property was introduced in that SDK version). This identifier describes the node for UI automation tools that work by querying the accessibility hierarchy, such as Android UI Automator, iOS XCUITest, or Appium. It's not exposed to users.
- All previously deprecated code, marked with the
@Deprecatedannotation, has been removed. Including color font emojis (you can still use them on your own viaEmojiFlag.customconstructor, example code is provided in theexampleproject).
NEW FEATURES
- All pickers are updated with accessibility in mind, ensuring seamless integration with screen readers and assistive technologies. Feel free to use SemanticsDebugger to check it.
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.CountryFlagnow have non-required child property.
REFACTOR
- New asserts in the constructors and optimizations in several country flag painters.
TESTS
- Added tests for new flag asserts and update goldens with arabic fonts.
1.6.0 #
NEW FEATURES
The package now uses CountryFlag from the world_flags package to display flags in the default country and phone code pickers. This approach offers several benefits:
- More customization:
CountryFlagprovides greater flexibility for customizing the appearance of flags. - Improved performance: These flags offer better performance compared to the assets.
- Platform independence: They work seamlessly across different platforms.
- No assets required: Since they are drawn using Flutter's
CustomPainter, they don't require additional platform dependant and heavy font assets.
Asset based
EmojiFlags are being deprecated, but you can still use them until the next major update, you will be also able to use them after v2.0.0 withEmojiFlag.customif needed.
MaterialApp(
...
theme: ThemeData(
extensions: const <ThemeExtension>[
/// The `emojiFamily` will work until v2.0.0, with old, assets based flags.
CountryTileThemeData(emojiFamily: EmojiFamily.twemoji),
/// Instead you can migrate to FlagThemeData, where you can specify way more properties.
FlagThemeData(
decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(4))),
),
],
)
);
1.5.0 #
NEW FEATURES
- 🎉 All translations in the eco-system packages now support all GlobalMaterialLocalizations and GlobalCupertinoLocalizations locales.
- 🦾 Countries translations now also support all
GlobalMaterialLocalization+GlobalCupertinoLocalizationslocales. - The
localeparameter in themaybeTranslationmethod is now nullable. - The
permissiveconstructors are now even more permissive, onlynameandcodeparameters remain required. - Changed Vatican city
unMemberfield tofalseand fix Cape Verde coordinates Link to MR - Added new
DurationExtensionto thehelperslibrary. - Added new
TypedLocaleExtensionwith acopyWithTranslationsCache(Async)method. - Added
asyncTranslationCacheProcessingparameter for theTypedLocaleDelegate. - Added
withTranslationsCacheconstructor forTypedLocaleandIsoLocale. - Set default value for
startWithSearchin the country and phone code pickers also tofalse, to unify behavior across the pickers.
1.4.0 #
NEW FEATURES
- 🦾 Language translations now also support all
GlobalMaterialLocalization+GlobalCupertinoLocalizationslocales. - You can now provide translation caches list in
TypedLocaleDelegateand it's newselectiveCacheconstructor. This is useful when you don't want to cache the translations for the specific unused ISO objects. For example you are only using country pickers, so you might not need currency an language translations. In this case you can provide onlycountriesForTranslationCachefor the countries translation cache. - The
TypedLocale(so andIsoLocale) has new fields for storing translations cache (see the point above). - The
TypedLocale(so andIsoLocale) are now inherited fromBasicLocale(so andJsonEncodable), so they can be used in the translations directly. - Added
copyWithmethod in inTypedLocale(so andIsoLocale). - Added new
internationalNamegetter inIsoStandardizedinterface, representing the international name of the ISO object. - Added new
UpperCaseMapclass, thatUpperCaseIsoMapextends, a simple version ofUpperCaseIsoMapwithout key length checks andIsoStandardizedvalues requirement. - The
mapin theRegionalBlocis nowUpperCaseMap(with all it's benefits). - Added new
maybeFromAcronymfactory method in theRegionalBloc. - Added new
BasicLocaleclass, thatTranslatedNameextends. Representing a type-safe world locale (language, country/region code and script). - Deprecated
maybeTranslateandtranslatemethods for translated classes (usemaybeTranslationandtranslationinstead). - Added new
commonNamesCacheMapmethod for all ISO based sealed classes collections, which allows to create a cache map of common names translations for the givenBasicLocale.
BREAKING CHANGES
Because of the BasicLocale changes (described above), translation() and maybeTranslation() methods on the Translated classes now require BasicLocale input. If you are not using those methods directly, then you don't need to change anything, otherwise you will need to do small adjustment - wrap the content of those methods with a BasicLocale.
Before:
print(iso?.maybeTranslation(LangPor()));
After:
print(iso?.maybeTranslation(BasicLocale(LangPor())));
Or just:
- Enable Regular Expressions in your IDE's Find and Replace panel.
- In the Find field, enter the regex:
(translation\()(.*)(\)) - In the Replace field, enter:
$1BasicLocale($2)$3 - Execute the replace operation.
1.3.1 #
NEW FEATURES
- Use of UX/UI interpretation of Hick's Law for conditionally showing search bar in the SearchableIndexedListViewBuilder - If no
showSearchBarvalue specified, it usesPickersThemeData.showHeadervalue as before but instead of falling back to default hardcodedfalsevalue it fallbacks to items count conditionif (items.length > 5). PickersThemeData.showHeaderis now nullable.- Fix thousands separator for CHF.
codeOtheris no longer nullable (in allIsoStandardizedclasses).- Added new compile-time constant and case-insensitive code maps (
UpperCaseIsoMaps) in every ISO class (accessible as static constants via.map,.codeMap,.codeNumericMap, etc.). - Factory constructors and methods now using those maps if no (optional) array is provided there.
- Factory constructors and methods in
IsoStandardizedclasses now allow non-String inputs - anyObject, for example you can now useStringBufferorEnuminstances directly:
enum IsoEnum {de, fr, ar} // On .fromCode(IsoEnum.de) call it will use "DE" input.
or you can basically use any custom class with toString() override:
class CustomIsoCodeClass {
const CustomIsoCodeClass({String code = '123', this.foo}) : _code = code;
final String _code;
final Foo? foo;
@override
String toString() => _code; // Has to override toString() with ISO value.
}
// On .fromAnyCode(CustomIsoCodeClass(code: ' 321 ')) call it will use "321" input.
REFACTOR
- Refactored asserts in
maybeMapIsoCodemethod. - Fixed typos in CHANGELOG and README.
1.2.0 #
NEW FEATURES
- Added new static
maybeFrom*methods and refactored old ones. They are also now accept anyObject?input instead of justString?. - Added new and refactored old tests with a performance in mind.
- Added new
firstIsoWhere*extensions on ISO iterables. - Improved annotations.
- Added
is*boolean getters for all ISO objects, for example:
if (isoObject.isFra) return _onFrench();
is more readable and shorter equivalent of this check:
if (isoObject == const LangFra()) return _onFrench();
1.1.0 #
NEW FEATURES
-
Added new constructor called
permissive- which allow the creation of custom class instances that are not fully compatible with the ISO standard. -
Translatedclass is now sealed - which means you can now directly compare instances of different ISO classes directly (for example in switch statements). -
Added theme extensions that you can specify in your
ThemeDatato provide global theme to your pickers. You can findPickersThemeData,CountryTileThemeData,CurrencyTileThemeDataandLanguageTileThemeData:
MaterialApp(
...
theme: ThemeData(
/// And also [CurrencyTileThemeData], [LanguageTileThemeData], [CountryTileThemeData]...
extensions: const <ThemeExtension>[
PickersThemeData(primary: true), // Specify global pickers theme.
],
)
);
This way you can specify for example that all your pickers lists are primary and define globally use of Twemoji as main flags font emoji family in all Country/Phone pickers in the app.
1.0.0 #
🎉 First anniversary and first stable release!
NEW FEATURES
-
Added new getter for
TranslatedNamename calledcommon, which might be useful in some cases whennameis being used by a parent class. -
Added a lot of translations from the Symfony.
-
Currencies translations now support all GlobalMaterialLocalizations and GlobalCupertinoLocalizations locales.
-
Updated LICENSE.
-
Added CLI tool for removing unused emoji font families on the Web platform
dart run world_countries:clean_build [--keep twemoji,notoemoji,openmoji] -
Added
fromSubtagsconstructors forIsoLocaleandTypedLocaleclasses. -
Added
defaultLocaleMapResolutionfor aTypedLocaleDelegatethat maps:filFilipino (Pilipino) totlTagalog.gswSwiss German Alemannic Alsatian tode_CHGerman (Switzerland).bs_CyrlBosnian (written in the Cyrillic script) tosrSerbian.
BREAKING CHANGES
- Removed code marked as
Deprecatedin previous releases. - Replaced old
FiatCurrency.listwith a newFiatCurrency.listExtended. - Removed
FiatCurrency.regularList(please useFiatCurrency.listinstead). - Marked Croatian Kuna as
Deprecated(currencies). - Moved helpers of world_country package to separate library:
BuildContextExtension,FunctionalPlatform,NameTextInput,ClearButtonandUiConstants. To migrate just use IDE suggestions or manually replace old references:
import "package:world_countries/world_countries.dart";
to a new one:
import "package:world_countries/helpers.dart";
0.9.0 #
NEW FEATURES
- Added new interface
IsoTranslatedwhich combinesTranslatedandIsoStandardizedinterfaces. - Added
standard*static constants in theWorldCountryclass referencing different names of the ISO 3166-1 standard. - Added
standard*static constants in theFiatCurrencyclass referencing different names of the ISO 4217 standard. - Improved documentation in README, added FAQ and demo web-site (Flutter WASM).
REFACTORING
- Removed
NavigatorContextExtensionfrom exports, so you don't need to specify it no longer viahide.
0.8.0 #
NEW FEATURES
- Added new factories to ISO classes -
fromAnyCode, which do the length and type checks and redirects to otherfromCode\*constructors - Added new static methods to ISO classes -
maybeFromAnyCode, which works same way asfromAnyCode, but doesn't throwsStateErrorsif no currency object is found. - Added
maybeMapIsoCodemethod toStringextensions, which is used under the hood of(maybe)fromAnyCode. - Added the
TypedLocaleDelegateclass, which can be used in thelocalizationsDelegates(such as inMaterialApp). It attempts to convert the string-basedLocaleto a strongly typedTypedLocale, which is then used in all pickers to provide translations for country/currency/language names. The detected TypedLocale? is also accessible viaTypedLocaleDelegate.maybeOf(context)or simplycontext.maybeLocale. - All pickers can have a local translation override via the
translationparameter (which will be used instead of the TypedLocale translation). - Translated classes now also have translate() and maybeTranslate() methods to translate it's data (country/currency/language names).
REFACTOR
- Slightly changed UI of default picker's tiles - added padding on top of the leading widget and swapped title with subtitle (because of translations provided to title).
- Named classes now has boolean flag (
short, defaults totrue). TranslatedNameclass by default returns.namevalue ontoString().- Refactored dollar symbols in
toString()methods.
BREAKING CHANGE
- Country and phone code pickers now using
TypedLocaleas translation parameter (to migrate just wrap your previous language there withIsoLocale()).
0.7.0 #
This is a general update that synchronizes underlying Dart package updates (related to translations and interfaces), as a preparation for a bigger upcoming update for localization delegates.
NEW FEATURES
WorldCountryclass now contains way more translations of language name to other languages (79 translations for each language minimum).- Refactored factory constructors - there is an optional parameter to provide custom list.
- Added
regularListgetter for the list of regular currencies (excludes 10 currencies from thespecialPurposeList). FiatCurrencyclass now contains translations of language name to other languages (79 translations for each language minimum).- Those translations are also accessible from the
translationandmaybeTranslationmethods. - Added
TranslatedNameclass for thetranslations. - Implement new abstract interfaces for currencies:
NamedandTranslated. - Added a new sealed class called
Script, based on the ISO 15924 standard. - The
NaturalLanguageclass now contains information about scripts (writing systems) and translations of the language name to other languages.
FIX
- Fixed several English currency names.
0.6.0 #
NEW FEATURES
- New searchSuggestions method in every picker (for use in
suggestionsBuilderof SearchAnchor) - Added search suggestions for search anchors.
- Added
copyWith,toJsonetc. to theWorldCountry,FiatCurrency,NaturalLanguageclasses. - Added copyWith, toJson etc. to all country-related sub-classes.
- Added new interfaces (
IsoStandardized,JsonEncodable) and typedef (JsonMap) to the model. - Refactoring in existing functional methods (sorting params to match list sorting).
- Translations are now
List<TranslatedName>instead ofList<CountryName>, howeverCountryNameis just an extension on top ofTranslatedName(you can reference to name instead ofcommonandfullNameinstead of official). There will be way more translations provided in upcoming version 0.7.0. - Renaming of extensions to follow the eco-system naming pattern.
REFACTOR
- Added new mixins.
- Improve example and docs.
0.5.0 #
- Factory constructors and static methods for data classes creation now implicitly trimming and comparing uppercase string inputs.
- Fixing old ignores and new linter rules.
- Updates in
dev_dependencies. - Added new data sealed classes related to world blocs.
- Regional blocs are now part of the world country data.
- Added regional blocs in the example
FIX
- Zimbabwean Dollar (ZWL) is now properly placed as last item in currencies list.
- Timezones for the Netherlands.
DOCUMENTATION
- Added web (Flutter WASM) example of data provided in this package.
BREAKING CHANGES
WorldCountry.listis now sorted alphabetically by the (3 letter)code.- Compile-time static const. data in lists are now sorted alphabetically by the (3 letter) code.
0.2.2 #
- Renamed
BuildContextExtensions>BuildContextExtension - Added extensions for Locale
REFACTOR
- Updates in
dev_dependencies.
0.2.1 #
DOCUMENTATION
- Provided structure screenshot.
0.2.0 #
TEST
- Increase code coverage to 96%.
0.1.0 #
DOCUMENTATION
- Provided code coverage links and badge.
0.0.1 #
- Initial release.
