postal_ko 1.0.0
postal_ko: ^1.0.0 copied to clipboard
A cross-platform Flutter package for Korean postal address search using Kakao postcode service. Supports both mobile and web platforms seamlessly.
π postal_ko #
A cross-platform Flutter package for Korean postal address search using Kakao postcode service.
β¨ Features #
- π± Cross-platform support: Works seamlessly on mobile (iOS/Android) and web platforms
- π Korean address search: Powered by Kakao postcode service
- π Web integration: Native web support with DOM manipulation
- π Geocoding support: Get latitude/longitude coordinates
- π‘οΈ Null-safe: Full null safety support
- π― Unified API: Single package for all platforms

π Getting Started #
Add postal_ko to your pubspec.yaml file:
dependencies:
postal_ko: ^1.0.0
π± Platform Support #
| Platform | Support | Notes |
|---|---|---|
| Android | β | Requires internet permission |
| iOS | β | Full support |
| Web | β | Native web integration |
| macOS | β | Not supported |
| Windows | β | Not supported |
| Linux | β | Not supported |
βοΈ Setup #
π€ Android #
Add internet permission to your AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET"/>
π iOS #
No additional setup required for basic usage.
π Web #
No additional setup required. The package automatically handles web integration.
π§ Local Server (Optional) #
If you want to use local server hosting:
Android
Add android:usesClearextTraffic="true" to your AndroidManifest.xml:
<application
android:label="[your_app]"
android:icon="@mipmap/ic_launcher"
android:usesCleartextTraffic="true">
...
</application>
iOS
Add NSAppTransportSecurity to your info.plist:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
πΊοΈ Kakao Geocoding (Optional) #
- Go to Kakao Developer Site
- Register developer and create app
- Add Web Platform and register domain:
- Default:
https://tykann.github.io - Local server:
http://localhost:8080
- Default:
- Use the JavaScript key as
kakaoKey
π Usage #
Basic Usage #
import 'package:postal_ko/postal_ko.dart';
// Using callback
TextButton(
onPressed: () async {
await Navigator.push(
context,
MaterialPageRoute(
builder: (_) => KpostalView(
callback: (Kpostal result) {
print('Address: ${result.address}');
print('Postal Code: ${result.postCode}');
print('Coordinates: ${result.latitude}, ${result.longitude}');
},
),
),
);
},
child: Text('Search Address'),
)
// Using return value
TextButton(
onPressed: () async {
Kpostal? result = await Navigator.push(
context,
MaterialPageRoute(builder: (_) => KpostalView()),
);
if (result != null) {
print('Selected address: ${result.address}');
}
},
child: Text('Search Address'),
)
Advanced Usage #
KpostalView(
useLocalServer: true, // Use local server (default: false)
localPort: 8080, // Local server port (default: 8080)
kakaoKey: 'your_kakao_js_key', // Optional Kakao geocoding
callback: (Kpostal result) {
// Handle result
print('Address: ${result.address}');
print('Building name: ${result.buildingName}');
print('Zone code: ${result.zonecode}');
print('Coordinates: ${result.latitude}, ${result.longitude}');
},
)
π Kpostal Model #
class Kpostal {
String postCode; // Postal code
String address; // Full address
String jibunAddress; // Jibun address
String roadAddress; // Road address
String buildingName; // Building name
String zonecode; // Zone code
double? latitude; // Latitude (from geocoding)
double? longitude; // Longitude (from geocoding)
// ... and more fields
}
π Web Support #
The package automatically detects the platform and provides appropriate implementation:
- Mobile: Uses
InAppWebViewfor embedded web content - Web: Uses native DOM manipulation and JavaScript interop
No additional configuration needed - it just works! π
π§ Migration from kpostal #
If you're migrating from the original kpostal package:
-
Update your
pubspec.yaml:dependencies: postal_ko: ^1.0.0 # Replace kpostal -
Update imports:
// Old import 'package:kpostal/kpostal.dart'; // New import 'package:postal_ko/postal_ko.dart'; -
The API remains the same - no code changes needed! β¨
π€ Contributing #
Contributions are welcome! Please feel free to submit a Pull Request.
π License #
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments #
- Inspired by the original kpostal package
- Built with Kakao Postcode Service
- Thanks to all contributors and users! π