country_flags_world 2.0.3
country_flags_world: ^2.0.3 copied to clipboard
A Flutter package for displaying country flags using images from flagcdn.com with advanced features and optimizations
Changelog #
2.0.3 - 2024-12-19 #
Added #
- CountryFlagWithName Widget: New widget that displays country flag with country name
- Enhanced Layout Options: Support for horizontal and vertical layouts
- Customizable Text Styling: Full control over country name appearance
- Flexible Spacing: Configurable spacing between flag and country name
- Multiple Constructor Variants: Small, medium, large, and extra large variants
- Flag Shapes: 8 different flag shapes (rectangle, circle, square, rounded, stadium, diamond, etc.)
- Shape System: Flexible shape system with automatic border radius and clipping
- Shape Integration: Full shape support in both CountryFlag and CountryFlagWithName widgets
Updated #
- Repository Links: Updated to point to the correct GitHub repository
- Package Description: Enhanced description for better pub.dev visibility
- Version Bump: Updated to version 2.0.3
2.0.2 - 2025-09-12 #
2.0.1 - 2025-09-12 #
Added #
- SVG support via
useSvginCountryFlag CountryHelper.getFlagSvgUrlandgetAllFlagUrlsincludessvg- Unified entry file
lib/country_flags.dart
Changed #
- README updated to correct package name and imports
- Bumped dependencies: add
flutter_svg
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
2.0.0 - 2025-01-27 #
Added #
- Cached Network Images: Added
cached_network_imagedependency for better performance and offline support - CountryHelper Class: New utility class for country code validation, normalization, and country name lookup
- FlagSize Enum: Type-safe enum for different flag sizes (w20, w40, w80, w160, w320, w640)
- ShimmerWidget: Beautiful shimmer loading animation for better UX
- Country Code Validation: Built-in validation for ISO alpha-2 country codes with customizable error messages
- Multiple Flag Sizes: Support for 6 different flag sizes from flagcdn.com
- Enhanced Error Handling: Better error messages and customizable fallback widgets
- Memory Optimization: Added memory cache width/height for better performance
- New Constructor Methods: Added
CountryFlag.extraLarge()constructor - Comprehensive Country Database: Complete mapping of 249+ countries with names and codes
Changed #
- Breaking: Updated predefined sizes to match flagcdn.com standards:
CountryFlag.small(): 20x13 (was 80x60)CountryFlag.medium(): 40x27 (was 120x90)CountryFlag.large(): 80x53 (was 160x120)CountryFlag.extraLarge(): 160x107 (new)
- Breaking: Updated minimum Flutter version to 3.24.0 and Dart SDK to 3.5.0
- Breaking: Replaced
Image.networkwithCachedNetworkImagefor better performance - Enhanced: Improved loading states with shimmer effects
- Enhanced: Better error handling with detailed error messages
New Parameters #
flagSize: Specify exact flag size from flagcdn.comshowShimmer: Enable/disable shimmer loading animationshimmerColor: Customize shimmer effect colorvalidateCountryCode: Enable/disable country code validationinvalidCountryCodeMessage: Custom error message for invalid codes
Dependencies #
- Updated
httpto ^1.2.0 - Added
cached_network_image^3.3.1 - Updated
flutter_lintsto ^4.0.0 - Added
mockito^5.4.4 for testing
Testing #
- Added comprehensive unit tests for all new features
- Added tests for CountryHelper utility class
- Added tests for FlagSize enum
- Enhanced existing widget tests
1.0.0 - 2025-01-27 #
Added #
- Initial release of country_flags package
CountryFlagwidget for displaying country flags- Support for ISO alpha-2 country codes
- Automatic country code normalization (uppercase to lowercase)
- Customizable size, fit, border radius, and decoration
- Predefined sizes: small (80x60), medium (120x90), large (160x120)
- Loading indicators and error handling
- Custom placeholder and fallback widgets
- Network image loading from flagcdn.com
- Comprehensive documentation and examples
- Unit tests for all features