country_code_helper 0.3.0
country_code_helper: ^0.3.0 copied to clipboard
Flutter country picker with built-in themed bottom sheet, phone-field prefix, bundled flag assets, SIM detection, and phone number parsing/validation.
CHANGES #
0.3.0 #
Highlights #
- Pure Dart — dropped
flutter_libphonenumberand removed the hard dependency onsim_card_code. No native code, no Android KGP, no iOS SwiftPM coupling. Zero plugin warnings for consumers. - Built-in
showCountryPickerSheetmodal — no more wrappingCountryPickerWidgetin your own bottom sheet. CountryCodePrefixwidget for phone-input fields (flag + dial code + divider).- Modernized picker UI — Material 3 theming, drag handle, search with prefix icon + inline clear, selection state, empty state, RTL-friendly paddings, divider between priority and full list.
API #
PhoneNumberTools.parseis now synchronous (was async). Reimplemented on top ofphone_numbers_parser.PhoneNumberTools.validateMobile/validateFixedLineadded.PhoneNumberToolsmethods are nowstatic.CountryCode.initCountryaccepts an optionalregionResolvercallback so apps can plug in SIM-card detection (e.g. viasim_card_code) without forcing every consumer to pull native deps. Default detection isPlatformDispatcher.locales. Now returnsCountry?(was always non-null).- New
CountryCode.detectCountry({fallback})andCountryCode.detectRegionCode(). - New
CountryCode.getCountryByCallingCode(...). Country.localizedName(locale),copyWith, value-based==/hashCode,toJson.CountryPickerConfig.itemBuildersignature changed to(context, country, selected).
Performance #
- Pre-normalized search keys per locale (one
String.containsper row). - Debounced search (80 ms).
- Fixed-extent
ListView.builderwithitemExtentfor O(1) scroll-to-index. RepaintBoundaryaround tiles + keyed.cacheWidth+FilterQuality.mediumon flag images.
Fixes #
- Priority codes are ordered exactly as provided.
initCountryno longer silently returns the first country on a missed lookup.
Internal #
- Removed
flutter_hooks/modal_bottom_sheetfrom example. - Trimmed example app and modernized Android setup (Gradle 8.14, AGP 8.13.2, Kotlin 2.2.20 via built-in Kotlin override).
0.2.4 #
- Update dependencies (packages)
0.2.3 #
- Update dependencies (packages)
0.2.2 #
- Update dependencies (packages)
- Update Syrian Flag
0.2.1 #
- Update dependencies (packages)
- UI enhancements
0.2.0 #
- Update dependencies (packages)
0.1.2 #
- Remove network flags
- Add Kurdistan as a country
- Optimize code
0.1.1 #
- Add network flag using flagcdn.com
0.1.0 #
- Add exclude feature
0.0.3 #
- Correct package repo url
0.0.2 #
- Remove logs
0.0.1 #
- Release the package