Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
c507743
chore(deps): bump melos from 6.3.3 to 7.1.1
dependabot[bot] Sep 15, 2025
82576dd
Merge branch 'release-0.23.0' into dependabot/pub/melos-7.1.1
gabbopalma Sep 27, 2025
4731725
Add run-bootstrap option to melos-action in CI workflow
gabbopalma Sep 27, 2025
1be6783
Update CI workflow to use melos run commands for formatting and analy…
gabbopalma Sep 27, 2025
8a6048d
Fix melos.yaml to by replacing 'exec' with 'run' for single package s…
gabbopalma Sep 27, 2025
07f2912
Moved existing script from melos.yaml to pubspec.yaml
gabbopalma Sep 27, 2025
786b704
(try) New melos syntax for scripts in pubspec.yaml
gabbopalma Sep 27, 2025
2b84ebd
Merge branch 'release-0.23.0' into dependabot/pub/melos-7.1.1
gabbopalma Sep 29, 2025
7f543b8
chore: update SDK constraints and dependencies across all packages to…
gabbopalma Sep 29, 2025
255d45e
fix: analyze-all script now has melos 7.1.1 syntax
gabbopalma Sep 29, 2025
c571fbd
chore: fixed all fatal warning and infos given by new analyzer version
gabbopalma Sep 29, 2025
2cdca77
chore: runned dart format .
gabbopalma Sep 29, 2025
9abffdc
chore: enhance generate script with Dart formatting support
gabbopalma Sep 29, 2025
790b235
chore: update dependabot configuration to include additional patterns…
gabbopalma Sep 29, 2025
6a56817
chore: remove Dart version pragma from generated files to prevent mis…
gabbopalma Sep 29, 2025
8a35357
refactor: streamline Dart file formatting by using the command line t…
gabbopalma Sep 29, 2025
aa99736
docs: update CONTRIBUTING.md and README.md to clarify code generation…
gabbopalma Sep 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 123 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,128 @@
version: 2
enable-beta-ecosystems: true

updates:
- package-ecosystem: "github-actions"
directory: "/"
# GitHub Actions
- package-ecosystem: github-actions
directory: /
schedule:
interval: "daily"
- package-ecosystem: "pub"
directory: "/"
interval: daily

# Workspace root
- package-ecosystem: pub
directory: /
schedule:
interval: "daily"
interval: daily
open-pull-requests-limit: 10
groups:
root-runtime-deps:
applies-to: version-updates
patterns:
- "*"

# Code generation scripts
- package-ecosystem: pub
directory: /scripts
schedule:
interval: daily
groups:
codegen-tools:
applies-to: version-updates
patterns:
- dart_style
- mustache_template
- recase
- "*"

# Core plugin
- package-ecosystem: pub
directory: /maplibre_gl
schedule:
interval: daily
groups:
maplibre-gl-core:
applies-to: version-updates
patterns:
- "*"

# Web implementation
- package-ecosystem: pub
directory: /maplibre_gl_web
schedule:
interval: daily
groups:
maplibre-gl-web:
applies-to: version-updates
patterns:
- "*"

# Platform interface
- package-ecosystem: pub
directory: /maplibre_gl_platform_interface
schedule:
interval: daily
groups:
platform-interface:
applies-to: version-updates
patterns:
- "*"

# Example app dependencies
- package-ecosystem: pub
directory: /maplibre_gl_example
schedule:
interval: daily
groups:
example-deps:
applies-to: version-updates
patterns:
- "*"

# Android Gradle (core plugin module)
- package-ecosystem: gradle
directory: /maplibre_gl/android
schedule:
interval: weekly
groups:
gradle-plugin:
applies-to: version-updates
patterns:
- gradle
- com.android.tools.build:gradle
kotlin:
applies-to: version-updates
patterns:
- org.jetbrains.kotlin:kotlin-*
androidx-core:
applies-to: version-updates
patterns:
- androidx.core:*
- androidx.annotation:*
google-maps-play-services:
applies-to: version-updates
patterns:
- com.google.android.gms:play-services-*

# Android Gradle (example app)
- package-ecosystem: gradle
directory: /maplibre_gl_example/android
schedule:
interval: weekly
groups:
gradle-plugin:
applies-to: version-updates
patterns:
- gradle
- com.android.tools.build:gradle
kotlin:
applies-to: version-updates
patterns:
- org.jetbrains.kotlin:kotlin-*
androidx:
applies-to: version-updates
patterns:
- androidx.*:*
google-play-services:
applies-to: version-updates
patterns:
- com.google.android.gms:play-services-*
28 changes: 22 additions & 6 deletions .github/workflows/flutter_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ jobs:
channel: stable
cache: true
- uses: bluefireteam/melos-action@v3
with:
run-bootstrap: true
- name: Lint analysis
run: melos format --set-exit-if-changed .
run: melos run format-all

lint:
name: "Static code analysis"
Expand All @@ -31,8 +33,10 @@ jobs:
channel: stable
cache: true
- uses: bluefireteam/melos-action@v3
with:
run-bootstrap: true
- name: Lint analysis
run: melos analyze --fatal-warnings --fatal-infos --concurrency 10
run: melos run analyze-all

test:
name: "Run tests"
Expand All @@ -44,7 +48,9 @@ jobs:
channel: stable
cache: true
- uses: bluefireteam/melos-action@v3
- run: melos test:io
with:
run-bootstrap: true
- run: melos run test:io

test-web:
name: "Run web tests"
Expand All @@ -56,7 +62,9 @@ jobs:
channel: stable
cache: true
- uses: bluefireteam/melos-action@v3
- run: melos test:web
with:
run-bootstrap: true
- run: melos run test:web

code-gen:
name: "Generate code from templates"
Expand All @@ -68,8 +76,10 @@ jobs:
channel: stable
cache: true
- uses: bluefireteam/melos-action@v3
- run: melos generate
- run: melos format
with:
run-bootstrap: true
- run: melos run generate
- run: melos run format-all
- name: Check Git changes
uses: multani/git-changes-action@v1

Expand All @@ -86,6 +96,8 @@ jobs:
channel: stable
cache: true
- uses: bluefireteam/melos-action@v3
with:
run-bootstrap: true
- uses: actions/setup-java@v5
with:
java-version: '21'
Expand All @@ -112,6 +124,8 @@ jobs:
channel: stable
cache: true
- uses: bluefireteam/melos-action@v3
with:
run-bootstrap: true
- uses: maxim-lobanov/setup-cocoapods@v1
with:
podfile-path: maplibre_gl_example/ios/Podfile.lock
Expand All @@ -136,5 +150,7 @@ jobs:
channel: stable
cache: true
- uses: bluefireteam/melos-action@v3
with:
run-bootstrap: true
- name: Build web
run: flutter build web
33 changes: 33 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,36 @@ interested in making contributions:
4. If there are any changes that developers should be aware of, please update
the [changelog](https://github.com/maplibre/flutter-maplibre-gl/blob/master/CHANGELOG.md)
once your pull request has been merged to the `main` branch.

## Code Generation & Formatting

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:

1. Make or adjust templates / generator logic under `scripts/` (main entry: `scripts/lib/generate.dart`).

2. Activate Melos and run a clean bootstrap:
```bash
dart pub global activate melos && melos clean && melos bootstrap
```
3. Run the generator:
```bash
melos run generate
```
4. (Optional) Run the workspace formatter (Dart files generated are already batch‑formatted automatically):
```bash
melos format-all
```
5. Review changes:
```bash
git diff
```
6. Stage & commit if everything looks correct.

Notes:
- The generator itself batch‑formats newly created Dart files using `dart format` so CI should not introduce extra diffs.
- Running `melos format-all` afterward 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/`.
3 changes: 3 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ analyzer:
strict-raw-types: false
strict-inference: false

errors:
avoid_catches_without_on_clauses: ignore

linter:
rules:
# temporary rules
Expand Down
12 changes: 4 additions & 8 deletions maplibre_gl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,18 +319,14 @@ but it seems like the expression still works well.
## Contributing

Setup [melos](https://melos.invertase.dev/~melos-latest/getting-started) and run
the

```bash
melos bootstrap
```

command in the plugin root directory. Run the example app and familiarize
yourself with the plugin directory structure.
the `melos bootstrap` command in the plugin root directory.\
Run the example app and familiarize yourself with the plugin directory structure.

[Feedback](https://github.com/maplibre/flutter-maplibre-gl/issues), contributing
pull requests
and [bug reports](https://github.com/maplibre/flutter-maplibre-gl/issues) are
very welcome - check
the [CONTRIBUTING.md](https://github.com/maplibre/flutter-maplibre-gl/blob/main/CONTRIBUTING.md)
guidelines.

**Generated code**: Some API surface (layer/source property helpers, expression utilities) is produced via a generator under `scripts/`. Do not modify generated files directly—see the Code Generation & Formatting section in `CONTRIBUTING.md` for the workflow (`melos run generate` then `melos format-all`).
2 changes: 1 addition & 1 deletion maplibre_gl/lib/maplibre_gl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
/// Vector and GeoJson sources are displayed by adding a "line", "fill", "symbol" or "circle" layer to the MapLibre GL style and specifying
/// which source to use (by setting the "source" property of the layer to the id of the source) as well as how to style the data by setting other properties of the layer such as "line-color" or "fill-outline-color".
/// For example, a vector source layer (or a GeoJson source layer) with the outlines of countries could be displayed both by a fill layer to fill the countries with a color and by a line layer to draw the outlines of the countries.
library maplibre_gl;
library;

import 'dart:async';
import 'dart:convert';
Expand Down
10 changes: 5 additions & 5 deletions maplibre_gl/lib/src/annotation_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ abstract class AnnotationManager<T extends Annotation> {
}) : id = getRandomString() {
for (var i = 0; i < allLayerProperties.length; i++) {
final layerId = _makeLayerId(i);
controller.addGeoJsonSource(layerId, buildFeatureCollection([]),
promoteId: "id");
controller.addLayer(
unawaited(controller.addGeoJsonSource(layerId, buildFeatureCollection([]),
promoteId: "id"));
unawaited(controller.addLayer(
layerId,
layerId,
allLayerProperties[i],
enableInteraction: enableInteraction,
);
));
}

controller.onFeatureDrag.add(_onDrag);
Expand Down Expand Up @@ -130,7 +130,7 @@ abstract class AnnotationManager<T extends Annotation> {
}
}

_onDrag(
Future<void> _onDrag(
Point<double> point,
LatLng origin,
LatLng current,
Expand Down
2 changes: 1 addition & 1 deletion maplibre_gl/lib/src/color_tools.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ignore_for_file: deprecated_member_use
// ignore_for_file: deprecated_member_use --- IGNORE ---

part of '../maplibre_gl.dart';

Expand Down
2 changes: 1 addition & 1 deletion maplibre_gl/lib/src/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class MapLibreMapController extends ChangeNotifier {
CameraPosition? get cameraPosition => _cameraPosition;
CameraPosition? _cameraPosition;

final MapLibrePlatform _maplibrePlatform; //ignore: unused_field
final MapLibrePlatform _maplibrePlatform;

/// Tracks whether the controller has already been disposed
bool _isDisposed = false;
Expand Down
11 changes: 6 additions & 5 deletions maplibre_gl/lib/src/maplibre_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,11 @@ class _MapLibreMapState extends State<MapLibreMap> {
}

@override
void didUpdateWidget(MapLibreMap oldWidget) {
Future<void> didUpdateWidget(MapLibreMap oldWidget) async {
super.didUpdateWidget(oldWidget);
final newOptions = _MapLibreMapOptions.fromWidget(widget);
final updates = _maplibreMapOptions.updatesMap(newOptions);
_updateOptions(updates);
await _updateOptions(updates);
_maplibreMapOptions = newOptions;
}

Expand All @@ -330,18 +330,19 @@ class _MapLibreMapState extends State<MapLibreMap> {
return;
}
final controller = await _controller.future;
controller._updateMapOptions(updates);
await controller._updateMapOptions(updates);
}

Future<void> onPlatformViewCreated(int id) async {
final controller = MapLibreMapController(
maplibrePlatform: _maplibrePlatform,
initialCameraPosition: widget.initialCameraPosition,
onStyleLoadedCallback: () {
onStyleLoadedCallback: () async {
if (_controller.isCompleted) {
widget.onStyleLoadedCallback?.call();
} else {
_controller.future.then((_) => widget.onStyleLoadedCallback?.call());
await _controller.future
.then((_) => widget.onStyleLoadedCallback?.call());
}
},
onMapClick: widget.onMapClick,
Expand Down
5 changes: 3 additions & 2 deletions maplibre_gl/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ description: A Flutter plugin for integrating MapLibre Maps inside a Flutter app
version: 0.22.0
repository: https://github.com/maplibre/flutter-maplibre-gl
issue_tracker: https://github.com/maplibre/flutter-maplibre-gl/issues
resolution: workspace

environment:
sdk: '>=3.4.0 <4.0.0'
sdk: ">=3.5.0 <4.0.0"
flutter: '>=3.22.0'

dependencies:
Expand All @@ -15,7 +16,7 @@ dependencies:
maplibre_gl_web: ^0.22.0

dev_dependencies:
very_good_analysis: ^5.0.0
very_good_analysis: ^10.0.0

flutter:
plugin:
Expand Down
Loading