ug_locations 0.3.0
ug_locations: ^0.3.0 copied to clipboard
Offline Flutter/Dart library for Uganda's administrative-unit hierarchy: village, parish, subcounty, and district lookup with fuzzy search, backed by SQLite.
0.3.0 #
LocationSearchFieldgainedinitialValueto seed the field with existing text (e.g. a saved village when editing a record),onTextChangedto receive free text that doesn't match any suggestion, and an opt-indebounceDurationto delay searches until typing pauses instead of querying on every keystroke.LocationPickergainedinitialLocationto pre-select every dropdown (Region/Sub-region through Village) for the same edit-existing-record case, loading each level's options so the seeded value is valid. Doesn't fireonSelectedfor it since the caller already has the value.- Added
ug(a resolvedUgandaLocations?instance) to bothLocationSearchFieldandLocationPickeras the recommended way to inject a specific instance, e.g. in tests.locations(aFuture<UgandaLocations>?) is deprecated in its favor but still works. - Fixed:
LocationSearchFieldnow shows a loading indicator under the field while itsUgandaLocationsinstance is still resolving, instead of looking like there are simply no matches.
0.2.1 #
- Fixed screenshot rendering in package readme
0.2.0 #
- Added
LocationPicker(cascading District → Subcounty → Parish → Village selector) andLocationSearchField(autocomplete search field) — ready-made Flutter widgets exported frompackage:ug_locations/ug_locations.dart, so consumers no longer have to hand-roll UI on top of the lookup API. See the example app's "Bundled widgets" tab. - Added web support: a new
QueryExecutorabstraction lets the package run onsqflite(Android/iOS/desktop, unchanged) or a newsqlite3-wasm backend (web), bundlingassets/sqlite3.wasmand addingSqlite3WasmQueryExecutor/UgLocationsDatabaseWebfor that platform. - Replaced the bundled data source:
assets/ug_locations.dbis now built from a current administrative-units dataset (146 districts, 52,000+ unique villages) instead of the July 2022 Electoral Commission snapshot (145 districts). - Added
regionandsubRegiontoUgandaLocation, plusgetRegions(),getSubRegionsInRegion(region), andgetDistrictsInSubRegion(subRegion)onUgandaLocations. LocationPickergained an opt-inincludeRegionHierarchyparameter (defaults tofalse) that prepends Region and Sub-region dropdowns above District.- Breaking: renamed
UgandaLocation.constituencytoUgandaLocation.county, now sourced from the new dataset'scountycolumn instead of an electoral constituency name. - Added
tool/build_source_json.dart, which buildstool/source_data/data-optimized.jsonfromuganda-locations-full.csv— the new first step in regenerating the bundled database. - Fixed: on Android/iOS/desktop, an app that had already run against an older
ug_locationsversion would keep using its previously-cached copy ofug_locations.dbforever (it was only ever copied "if not already present"), so this schema change would crash existing installs withno such column: region. Cached copies are now invalidated by a schema-version marker and re-copied automatically on the next app restart.
0.1.1 #
- Update README documentation.
0.1.0 #
- Initial release: a Dart/Flutter port of the
ug-locationsnpm package. - SQLite-backed storage (bundled
assets/ug_locations.db), queried viasqflite. - Full API parity with the original JS package:
getDistricts,getLocationByVillage,getVillagesInParish,getParishesInSubcounty,getSubcountiesInDistrict,search,getPath,getParent— all nowFuture-based.