We welcome contributions of all kinds: bug fixes, new features, documentation improvements, benchmarks, and issue triage. This guide explains how to work effectively in this repository.
- Fork & create a feature branch from
main(or the current release prep branch if coordinating). - Run workspace bootstrap with Melos:
dart pub global activate melos melos bootstrap
- Make changes (add tests, update example where relevant).
- Regenerate code if you touched style/source definitions:
melos run generate && melos format-all - Run analyzer & tests:
melos analyze-all melos test - Update CHANGELOG(s) if user‑visible behavior changed.
- Open a Pull Request (PR) and fill out the template.
- Search existing issues & PRs to avoid duplication.
- For larger features, open a brief proposal issue or discussion first to align scope & design.
- Keep PRs focused: small, reviewable units are merged faster.
maplibre_gl/ # Main Flutter plugin (Android/iOS bindings + shared Dart API)
maplibre_gl_platform_interface/ # Federated plugin interface (abstractions & shared types)
maplibre_gl_web/ # Web implementation (maplibre-gl-js bridge)
maplibre_gl_example/ # Example app (integration & usage demos)
scripts/ # Code generation templates and generator entrypoints
Generated code lives inside the plugin packages — never modify it directly (see Code Generation section).
| Tool | Minimum / Expected | Notes |
|---|---|---|
| Flutter SDK | Stable channel (latest) | Ensure flutter doctor is clean |
| Dart | Comes with Flutter | Required for generator scripts |
| Melos | Latest | Workspace orchestration |
| Java / Android SDK | As per Flutter requirements | For Android builds |
| Xcode | Current stable | For iOS builds |
Optional: just/make scripts (if later added), Node (only if experimenting with web build tooling).
- Bootstrap:
melos bootstrap - (Optional) Clean:
melos cleanif dependency graph changed significantly. - Develop inside the package needing changes; update the example app to showcase new APIs.
- Run local verification: analyze, test, run example on target platforms.
- Commit with a clear message; push branch & open PR.
main: Always buildable; contains latest released or soon‑to‑be released code.- Release prep branches (e.g.
release-v.X.Y.Z): Used briefly before tagging. - Feature / fix branches:
feat/<short-description>orchore/<issue-id>(no strict enforcement, but clarity helps).
Not strictly enforced, but recommended pattern (Conventional Commit style):
feat: add circle layer dash pattern support
fix(ios): correct expression conversion for !has
chore: bump maplibre-native version
Why: Helps generate release notes & scan history quickly.
- Follow
analysis_options.yaml(pedantic / lints). Fix warnings before PR. - Keep public API additions minimal & purposeful; prefer consistency with existing naming.
- Null safety: avoid unnecessary
!; use safe patterns & explicit types. - Avoid wide diffs from formatting unrelated code.
When adding new layer/source property helpers or expression constructs:
- Update or create mapping logic in
scripts/lib/conversions.dart(or relevant template). - Run generation & formatting.
- Add usage sample in example app (new page or extend an existing one).
- Document in README if user‑facing.
Currently (if present):
- Unit tests under each package's
test/directory. - Run all tests:
melos test. - Add at least: success path + one edge case.
- For map rendering or gesture logic that's hard to unit test, prefer: clearly documented behavior + example reproduction steps.
Before submitting:
melos analyze
melos testIf adding platform‑channel changes, test both Android & iOS (simulator/emulator acceptable) plus web if impacted.
- Batch style or layer operations.
- Avoid unnecessary rebuilds of
MapLibreMapwidget in example pages. - Profile only when needed (Flutter DevTools / native profilers). Include notes if performance-sensitive code added.
Update the root CHANGELOG.md (and package‑specific ones if only a sub‑package changed) with a brief, user‑oriented entry:
### Added
- New heatmap gradient expression helper (#123)
Group entries under ## [Unreleased] (or the upcoming version header depending on existing pattern). The maintainers will finalize version numbers on release.
Some parts of the public API (layer & source property helpers, expression utilities, etc.) are generated.
Do not edit generated Dart / Java / Swift files manually. Instead:
- Make or adjust templates / generator logic under
scripts/(main entry:scripts/lib/generate.dart). - Activate Melos and run a clean bootstrap:
dart pub global activate melos && melos clean && melos bootstrap
- Run the generator:
melos run generate
- (Optional) Run the workspace formatter (Dart files generated are already batch‑formatted automatically):
melos format-all
- Review changes:
git diff
- Stage & commit if everything looks correct.
Notes:
- The generator itself batch‑formats newly created Dart files using
dart formatso CI should not introduce extra diffs. - Running
melos format-allafterward is still fine (idempotent) and catches accidental manual edits elsewhere. - Never hand‑edit generated files: your edits will be overwritten the next time the generator runs.
If you add new style specification fields, extend the mapping logic in scripts/lib/conversions.dart and/or templates under scripts/templates/.
Before marking your PR ready for review, verify:
- Example app updated (if API / behavior change)
- Tests added/updated (or rationale provided)
- Analyzer passes (no new warnings)
- Code generation re-run (if templates touched)
- Changelog updated
- No unrelated formatting noise
- All platforms tested that are affected
- Screenshots / recordings included for UI changes (if applicable)
Found a vulnerability or sensitive exposure vector?
- Do not open a public issue with exploit details first.
- Email the maintainers or use GitHub security advisories if enabled.
- Provide reproduction steps & potential impact.
A high-level outline (subject to change):
- Ensure
main(or release branch) is green (CI, tests, analyzer). - Update package versions & root/individual
CHANGELOG.mdsections following the pre-1.0 versioning policy in RELEASE.md:- MINOR version for breaking changes, significant features, or new functionality
- PATCH version for backward-compatible bug fixes
- Tag the release (
v0.X.Y) and publish packages to pub.dev in dependency order. - Merge back any release branch into
main. - Announce in discussions (optional).
For more information, see RELEASE.md instructions.
Be respectful and constructive. We follow the project's CODE_OF_CONDUCT.md. Harassment, discrimination, or unprofessional behavior is not tolerated.
- Open a draft PR early to get directional feedback.
- Use Discussions for design clarifications.
- Reference upstream MapLibre issues if exposing a capability that exists natively.
When bumping native MapLibre engine versions:
- Link to upstream release notes.
- Test style load, camera operations, at least one annotation per type on both iOS & Android.
- Watch for symbol changes or removed APIs.
This fork builds upon earlier work of flutter-mapbox-gl contributors and the broader MapLibre community.
Your time and expertise help keep an open, vendor‑neutral mapping stack thriving in Flutter.