h3_flutter
0.8.0, released 2 weeks ago by festelo.net
Flutter version of Uber's H3 core hexagon-based geographic grid system.
WASM-ready
What it does
Provides cross-platform access to Uber's H3 hexagon-based geographic grid system. It delegates to h3_ffi on native platforms and h3_web on the web.
AI-written summary of version 0.8.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to work with Uber's H3 spatial index system in a Flutter application.
- You need cross-platform support including Android, iOS, web, Windows, macOS, and Linux.
Skip it when
- You are building a pure Dart backend application (use a pure Dart alternative instead).
- You do not need geospatial grid indexing.
Strengths
- Supports all major platforms: Android, iOS, web, Windows, macOS, and Linux.
- Supports WebAssembly (Wasm) builds on the web.
- Includes helper methods ported from Geojson2H3.
Weaknesses
- Requires manual static library building on iOS/macOS if cloned directly from git due to CMake requirements.
- Web version requires awaiting library loading before making H3 calls.
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 4
For mobile and desktop, simply add the package and load using H3Factory().load(). For web, it can automatically load h3-js or you can optionally add a script tag to web/index.html.
final h3Factory = const H3Factory();
final h3 = await h3Factory.load();
final hexagons = h3.polyfill(
resolution: 5,
coordinates: [
GeoCoord(20.4522, 54.7104),
GeoCoord(37.6173, 55.7558),
GeoCoord(39.7015, 47.2357),
],
);Alternatives
Packages that do the same job and could replace h3_flutter.