Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit f27bcab
Author: Joscha <34318751+josxha@users.noreply.github.com>
Date:   Sat May 18 23:49:28 2024 +0200

    feat: allow latest `flutter_lints` version (maplibre#419)

commit 8323f55
Author: Joscha <34318751+josxha@users.noreply.github.com>
Date:   Sat May 18 02:00:56 2024 +0200

    feat: add `flutter_lints`, fix or ignore lints (maplibre#414)

    Co-authored-by: Peter Leibiger <kuhnroyal@gmail.com>

commit e5d95ed
Author: Joscha <34318751+josxha@users.noreply.github.com>
Date:   Fri May 17 23:38:40 2024 +0200

    fix(web): ensure the usage of `maplibre-gl-js` version 4.x.x, remove `_addStylesheetToShadowRoot` (maplibre#409)

commit e617b90
Author: Joscha <34318751+josxha@users.noreply.github.com>
Date:   Fri May 17 16:33:47 2024 +0200

    feat: update package links in pubspec.yaml files (maplibre#413)

commit 68040d4
Author: Joscha <34318751+josxha@users.noreply.github.com>
Date:   Fri May 17 16:25:36 2024 +0200

    chore: delete `pubspec.lock` files (maplibre#412)

commit 3db5b2a
Author: Fabian Keunecke <github@fabiankeunecke.de>
Date:   Fri May 17 14:58:33 2024 +0200

    Support newer Gradle versions (maplibre#390)

commit 7cb6521
Author: Joscha <34318751+josxha@users.noreply.github.com>
Date:   Fri May 17 14:53:47 2024 +0200

    feat(web): allow package:js version 0.6.x and 0.7.x (maplibre#410)
  • Loading branch information
josxha committed May 21, 2024
1 parent d342d5a commit b266009
Show file tree
Hide file tree
Showing 60 changed files with 334 additions and 832 deletions.
38 changes: 6 additions & 32 deletions .github/workflows/flutter_beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,12 @@ env:
FLUTTER_CHANNEL: 'beta'

jobs:
format:
name: "Check formatting"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: ${{ env.FLUTTER_CHANNEL }}
cache: true
- name: Lint analysis
run: flutter format --set-exit-if-changed .

lint:
name: "Static code analysis"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: ${{ env.FLUTTER_CHANNEL }}
cache: true
- run: flutter pub get
- name: Lint analysis
run: flutter analyze

build-android:
name: "Build Android apk"
runs-on: ubuntu-latest
defaults:
run:
working-directory: example

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand All @@ -56,15 +28,18 @@ jobs:
- run: flutter pub get
- name: Build example APK
run: flutter build apk
# We might want to add a flutter test step in the future, when there actually are tests for this plugin
- name: Upload apk as artifact
uses: actions/upload-artifact@v4
with:
name: maplibre-flutter-demo.apk
path: example/build/app/outputs/flutter-apk/app-release.apk

build-iOS:
name: Build iOS package
runs-on: macos-latest
defaults:
run:
working-directory: example

steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
Expand All @@ -80,7 +55,7 @@ jobs:
- name: Upload Runner.app as artifact
uses: actions/upload-artifact@v4
with:
name: Runner.app
name: maplibre-flutter-demo.app
path: example/build/ios/iphonesimulator

build-web:
Expand All @@ -89,7 +64,6 @@ jobs:
defaults:
run:
working-directory: example

steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
Expand Down
50 changes: 26 additions & 24 deletions .github/workflows/flutter_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,25 @@ name: Flutter CI

on: [push, pull_request, workflow_dispatch]

env:
FLUTTER_CHANNEL: 'stable'
FLUTTER_VERSION: '3.10.5'

jobs:
format:
name: "Check formatting"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
cache: true
- name: Lint analysis
run: dart format --set-exit-if-changed .

lint:
name: "Static code analysis"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
cache: true
- run: flutter pub get
- run: |
Expand All @@ -46,37 +36,46 @@ jobs:
defaults:
run:
working-directory: example

strategy:
fail-fast: false
matrix:
sdk: [ '3.10.5', '' ]
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.sdk }}
cache: true
- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: 'gradle'
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
cache: true
- run: flutter pub get
- name: Build example APK
run: flutter build apk
# We might want to add a flutter test step in the future, when there actually are tests for this plugin
- name: Upload apk as artifact
uses: actions/upload-artifact@v4
if: ${{ matrix.sdk == '' }}
with:
name: maplibre-flutter-demo.apk
path: example/build/app/outputs/flutter-apk/app-release.apk

build-iOS:
name: Build iOS package
runs-on: macos-latest
defaults:
run:
working-directory: example

strategy:
fail-fast: false
matrix:
sdk: [ '3.10.5', '' ]
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
flutter-version: ${{ matrix.sdk }}
cache: true
- uses: maxim-lobanov/setup-cocoapods@v1
with:
Expand All @@ -85,9 +84,10 @@ jobs:
- name: Build iOS package
run: flutter build ios --simulator
- name: Upload Runner.app as artifact
if: ${{ matrix.sdk == '' }}
uses: actions/upload-artifact@v4
with:
name: Runner.app
name: maplibre-flutter-demo.app
path: example/build/ios/iphonesimulator

build-web:
Expand All @@ -96,13 +96,15 @@ jobs:
defaults:
run:
working-directory: example

strategy:
fail-fast: false
matrix:
sdk: [ '3.10.5', '' ]
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
flutter-version: ${{ matrix.sdk }}
cache: true
- run: flutter pub get
- name: Build web
Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/formatter.yml

This file was deleted.

6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## UNRELEASED

* Add support for Gradle/AGP namespace configuration
* Bump Android `compileSdkVersion` to 34
* Loosen the dependency constraint of [js](https://pub.dev/packages/js) to allow `0.6.x` and `0.7.x`.

## 0.18.0
### Breaking Change:
Already since 0.17.0, developers do not need to adapt their Podfile for iOS apps anymore as it was previously described in the Readme. Developers who previously added these lines should remove them, since not removing these lines may cause a build failure on iOS. (This change actually already landed in 0.17.0, but it may not have been sufficiently clear that not removing these lines might break builds).
Expand Down
7 changes: 7 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
include: package:flutter_lints/flutter.yaml

analyzer:
errors:
# remove once git dependencies have been removed
invalid_dependency: ignore

linter:
rules:
camel_case_types: false
constant_identifier_names: false
12 changes: 7 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ apply plugin: 'com.android.library'
apply plugin: 'org.jetbrains.kotlin.android'

android {
if (project.android.hasProperty("namespace")) {
namespace 'com.mapbox.mapboxgl'
}

compileSdkVersion 31
compileSdkVersion 34
ndkVersion "20.1.5948944"

defaultConfig {
Expand All @@ -39,16 +42,15 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
dependencies {
implementation 'org.maplibre.gl:android-sdk:10.2.0'
implementation 'org.maplibre.gl:android-plugin-annotation-v9:2.0.0'
implementation 'org.maplibre.gl:android-plugin-offline-v9:2.0.0'
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
}
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
}

dependencies {
Expand Down
30 changes: 15 additions & 15 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

import 'dart:io';

import 'package:device_info_plus/device_info_plus.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:location/location.dart';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:maplibre_gl/maplibre_gl.dart';
import 'package:maplibre_gl_example/attribution.dart';
import 'package:maplibre_gl_example/get_map_informations.dart';
import 'package:maplibre_gl_example/given_bounds.dart';
Expand All @@ -16,26 +17,24 @@ import 'package:maplibre_gl_example/no_location_permission_page.dart';

import 'animate_camera.dart';
import 'annotation_order_maps.dart';
import 'click_annotations.dart';
import 'custom_marker.dart';
import 'full_map.dart';
import 'layer.dart';
import 'line.dart';
import 'local_style.dart';
import 'map_ui.dart';
import 'move_camera.dart';
import 'click_annotations.dart';
import 'offline_regions.dart';
import 'page.dart';
import 'place_batch.dart';
import 'place_circle.dart';
import 'place_fill.dart';
import 'place_source.dart';
import 'place_symbol.dart';
import 'place_fill.dart';
import 'scrolling_map.dart';
import 'offline_regions.dart';
import 'custom_marker.dart';
import 'place_batch.dart';
import 'layer.dart';
import 'sources.dart';

import 'package:maplibre_gl/maplibre_gl.dart';

final List<ExamplePage> _allPages = <ExamplePage>[
const MapUiPage(),
const FullMapPage(),
Expand Down Expand Up @@ -94,13 +93,14 @@ class _MapsDemoState extends State<MapsDemo> {
await location.requestPermission();
}
}
if (!mounted) return;

Navigator.of(context).push(MaterialPageRoute<void>(
if (context.mounted) {
Navigator.of(context).push(MaterialPageRoute<void>(
builder: (_) => Scaffold(
appBar: AppBar(title: Text(page.title)),
body: page,
)));
appBar: AppBar(title: Text(page.title)),
body: page,
),
));
}
}

@override
Expand Down
6 changes: 4 additions & 2 deletions example/lib/map_ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,10 @@ class MapUiBodyState extends State<MapUiBody> {
debugPrint('# features: ${features.length}');
_clearFill();
if (features.isEmpty && _featureQueryFilter != null) {
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
content: Text('QueryRenderedFeatures: No features found!')));
if (context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
content: Text('QueryRenderedFeatures: No features found!')));
}
} else if (features.isNotEmpty) {
_drawFill(features);
}
Expand Down
4 changes: 2 additions & 2 deletions example/lib/sources.dart
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ class FullMapState extends State<FullMap> {
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
"Current source ${styleInfo.name}",
textScaleFactor: 1.4,
"Current source: ${styleInfo.name}",
style: Theme.of(context).textTheme.titleLarge,
),
),
),
Expand Down
Loading

0 comments on commit b266009

Please sign in to comment.