thai_address_picker 1.0.1
thai_address_picker: ^1.0.1 copied to clipboard
High-performance Thai address picker with Province, District, Subdistrict, Zip Code. Features auto-completion and reverse lookup.
Changelog #
All notable changes to this project will be documented in this file.
1.0.1 - 2025-01-08 #
Added #
- đ Enhanced documentation with usage examples
- â ī¸ Helpful error messages and warnings for optional dependencies (GetX, Provider)
- đĄī¸ Better error handling in example files
Fixed #
- đ Fixed example code that called non-existent
getZipCodesBySubDistrict()method- Changed to use
subDistrict.zipCodedirectly for accurate zip code retrieval - Applied fixes to:
repository_only_example.dart,standalone_usage_example.dart
- Changed to use
- đ§ Resolved null type issues in cascading selection logic
- Fixed
firstWhere()callbacks to properly handle null returns - Applied to Province, District, and SubDistrict lookups
- Fixed
- đ Fixed dangling doc comments in example files
- â All dart analyze issues resolved - zero issues found
Changed #
- đĻ Updated example files to properly handle optional dependencies
- GetX and Provider examples now clearly indicate they require additional setup
- Added helpful error messages in main menu when dependencies are missing
- đ§š Improved code organization in example implementations
Documentation #
- đ Updated README.md with version 1.0.1
- đ¯ Clarified optional dependency requirements for integration examples
1.0.0 - 2025-01-08 #
Added #
- đ§Ē comprehensive tests for Thai address picker functionality
- Implement unit tests for ThaiAddressNotifier to validate state management and selection logic for provinces, districts, sub-districts, and zip codes.
- Create widget tests for ThaiAddressForm to ensure proper rendering, interaction, and state updates based on user input.
- Develop tests for various components including village and zip code autocomplete to verify suggestion handling and selection callbacks.
- Enhance coverage for picker dialogs and bottom sheets to confirm correct display and interaction behavior.
- Ensure all tests utilize a fake asset bundle for consistent and isolated testing environments.
Changed #
- đĻ Bumped package version to 1.0.0
- đ Updated documentation to reflect new version and testing features
Fixed #
- đ Resolved minor bugs identified during testing phase
Performance #
- ⥠Optimized test execution time and reliability
Documentation #
- đ Added test documentation and usage examples
0.3.0 - 2025-01-08 #
Added #
- đī¸ Village Autocomplete Widget - Real-time village (ā¸Ģā¸Ąā¸šāšā¸āšā¸˛ā¸) search
- Substring matching for flexible Thai text search
- Shows full address hierarchy: Village âĸ ā¸Ģā¸Ąā¸šāšā¸ā¸ĩāš âĸ SubDistrict âĸ District âĸ Province
- Displays Moo number (ā¸Ģā¸Ąā¸šāšā¸ā¸ĩāš) for accurate identification
- Auto-fills all address fields when selected
- High-performance O(k) algorithm with early exit optimization
- Real-time updates from first character typed
- đ
searchVillages()method in repository with smart filtering - đī¸
VillageSuggestionclass for village autocomplete data - đ New example:
village_autocomplete_example.dartwith full feature showcase - đ Village data integration (~70,000+ villages)
- đ Spec file:
assets/data/spec/village.jsonfor data structure
Changed #
- đĻ Updated package description to include Village support
- đ¨ Enhanced repository to handle village search efficiently
- đ Improved data loading to include villages.json
Performance #
- ⥠O(k) complexity for village search with early exit (k = maxResults ⤠20)
- đ Substring matching optimization for Thai text
- đž Efficient HashMap-based filtering
- đ¯ No unnecessary state updates during search
Documentation #
- đ Updated README with Village Autocomplete usage
- đ Enhanced code comments for village-related features
- đ Added comprehensive example for village search
- đ Updated feature list and documentation
0.2.0 - 2025-01-07 #
Added #
- ⨠Zip Code Autocomplete Widget - Real-time auto-suggestions while typing
- Prefix matching for accurate suggestions (⏪ā¸Ģā¸ąā¸Ēā¸ā¸ĩāšāšā¸Ŗā¸´āšā¸Ąā¸āšā¸ā¸āšā¸§ā¸ĸ...)
- Shows full address hierarchy: ZipCode â SubDistrict â District â Province
- Handles multiple areas with same zip code (e.g., 10200 has 3 areas)
- Auto-fills all fields when suggestion is selected
- High-performance O(k log k) algorithm with early exit optimization
- Real-time updates from first digit typed
- đ
searchZipCodes()method in repository with smart filtering - đ¯
selectZipCodeSuggestion()in provider for auto-fill cascade - đ New example:
zip_code_autocomplete_example.dartwith full feature showcase - đ Comprehensive documentation:
ZIP_CODE_AUTOCOMPLETE.md
Changed #
- đ
ThaiAddressFormnow usesZipCodeAutocompleteinstead of plain TextField - ⥠Improved zip code input UX with real-time suggestions from first digit
- đ¨ Enhanced helper text: "⏪⏰ā¸ā¸ā¸ā¸°āšā¸ā¸°ā¸ā¸ŗā¸ā¸ĩāšā¸ā¸ĸā¸šāšā¸ā¸ąā¸āšā¸ā¸Ąā¸ąā¸ā¸´"
- đ Optimized
setZipCode()to handle partial input (< 5 digits) without errors
Fixed #
- đ Fixed issue with multiple subdistricts having same zip code
- đ§ Improved error state handling in zip code lookup
- â Clear selections properly when zip code has multiple areas
- đ¯ Fixed autocomplete to show suggestions from first digit (not just 5 digits)
Performance #
- ⥠O(k) complexity for zip code search with early exit (k = maxResults ⤠20)
- đ Prefix matching optimization for real-time responsiveness
- đž Efficient HashMap-based unique filtering
- đ¯ No unnecessary state updates during partial input
Documentation #
- đ Updated README with Zip Code Autocomplete usage
- đ Added comprehensive technical documentation
- đ Enhanced code comments for better maintainability
- đ Added example showcasing all features
0.1.0 - 2025-10-15 #
0.0.1 - 2025-01-07 #
Added #
- đ Initial release of Thai Address Picker
- đĻ Data models for Geography, Province, District, SubDistrict, and ThaiAddress using Freezed
- đī¸ Repository pattern with isolate-based JSON parsing for high performance
- đž In-memory caching with indexed lookups for O(1) search complexity
- đ Cascading selection logic (Province â District â SubDistrict â Zip Code)
- đ Reverse lookup functionality (Zip Code â Auto-fill address)
- đ¨
ThaiAddressFormwidget - Complete inline form with 4 fields - đą
ThaiAddressPicker.showBottomSheet()- Bottom sheet picker UI - đŦ
ThaiAddressPicker.showDialog()- Dialog picker UI - đ Bilingual support (Thai and English)
- ⥠High-performance background JSON parsing using compute (Isolates)
- đ¯ State management using flutter_riverpod
- đ§ Customizable styling and decoration for all form fields
- đ Latitude/longitude coordinates for sub-districts
- đ Search functionality for provinces, districts, and sub-districts
- đ Complete Thai address database with ~77 provinces, ~900+ districts, and 7,000+ sub-districts
Features #
- Clean Architecture with separation of concerns
- Singleton repository pattern for efficient data management
- Type-safe models with null safety
- Extensive documentation and examples
- Easy integration with existing Riverpod or non-Riverpod apps
- Handles edge cases (multiple sub-districts per zip code)
Developer Experience #
- Simple API with minimal boilerplate
- Comprehensive README with usage examples
- Example app demonstrating all features
- Clear error messages and state handling
- Flexible customization options