thai_address_picker 1.0.2 copy "thai_address_picker: ^1.0.2" to clipboard
thai_address_picker: ^1.0.2 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.2 - 2025-01-08 #

Added #

  • โœจ New Feature: showZipCodeAutocomplete parameter in ThaiAddressForm
    • Can now disable zip code autocomplete to show a simple TextField instead
    • Default: true (autocomplete enabled)
    • When false: Shows basic TextField without suggestions
  • ๐Ÿ“š New Examples:
    • disable_zipcode_autocomplete_example.dart - Basic example with disabled autocomplete
    • compare_zipcode_modes_example.dart - Side-by-side comparison of both modes
  • ๐Ÿ†• clearZipCode() method in ThaiAddressNotifier for better state management

Changed #

  • ๐Ÿ“– Updated README.md with:
    • Documentation for disabling zip code autocomplete
    • Comparison table of features (Autocomplete vs Simple)
    • Links to new example files
    • Complete Example Files section

Why This Update? #

  • Some users don't need autocomplete suggestions
  • Simpler UI for cases where users already know their zip code
  • Better performance for basic input scenarios
  • More flexibility and customization options

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.zipCode directly for accurate zip code retrieval
    • Applied fixes to: repository_only_example.dart, standalone_usage_example.dart
  • ๐Ÿ”ง Resolved null type issues in cascading selection logic
    • Fixed firstWhere() callbacks to properly handle null returns
    • Applied to Province, District, and SubDistrict lookups
  • ๐Ÿ“ 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
  • ๐Ÿ˜๏ธ VillageSuggestion class for village autocomplete data
  • ๐Ÿ“š New example: village_autocomplete_example.dart with full feature showcase
  • ๐Ÿ“Š Village data integration (~70,000+ villages)
  • ๐Ÿ“ Spec file: assets/data/spec/village.json for 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.dart with full feature showcase
  • ๐Ÿ“– Comprehensive documentation: ZIP_CODE_AUTOCOMPLETE.md

Changed #

  • ๐Ÿ”„ ThaiAddressForm now uses ZipCodeAutocomplete instead 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 #

Added #

  • ๐Ÿš€ Released version 0.1.0 with minor improvements and bug fixe

Fixed #

  • ๐Ÿ› Fixed minor bugs in address selection logic

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)
  • ๐ŸŽจ ThaiAddressForm widget - 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
0
likes
150
points
272
downloads

Publisher

verified publisherkidpech.app

Weekly Downloads

High-performance Thai address picker with Province, District, Subdistrict, Zip Code. Features auto-completion and reverse lookup.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_riverpod, freezed_annotation, json_annotation

More

Packages that depend on thai_address_picker