Skip to content

Commit 9116054

Browse files
authored
fix: wasm builds, add wasm CI (#121)
1 parent 72e0e06 commit 9116054

File tree

5 files changed

+47
-10
lines changed

5 files changed

+47
-10
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ jobs:
196196
# name: maplibre-flutter-demo.app
197197
# path: example/build/ios/iphonesimulator
198198
build-web:
199-
name: "Build web"
199+
name: "Build Web"
200200
runs-on: ubuntu-latest
201201
defaults:
202202
run:
@@ -215,3 +215,23 @@ jobs:
215215
run: dart pub get
216216
- name: Build web
217217
run: flutter build web
218+
build-web-wasm:
219+
name: "Build Web WASM"
220+
runs-on: ubuntu-latest
221+
defaults:
222+
run:
223+
working-directory: example
224+
strategy:
225+
fail-fast: false
226+
matrix:
227+
sdk: [ '3.24.3', '' ]
228+
steps:
229+
- uses: actions/checkout@v4
230+
- uses: subosito/flutter-action@v2
231+
with:
232+
flutter-version: ${{ matrix.sdk }}
233+
cache: true
234+
- name: "Get Flutter dependencies"
235+
run: dart pub get
236+
- name: Build web
237+
run: flutter build web --wasm

.github/workflows/flutter-beta.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
# name: maplibre-flutter-demo.app
5656
# path: example/build/ios/iphonesimulator
5757
build-web:
58-
name: "Build web"
58+
name: "Build Web"
5959
runs-on: ubuntu-latest
6060
defaults:
6161
run:
@@ -67,4 +67,18 @@ jobs:
6767
channel: ${{ env.FLUTTER_CHANNEL }}
6868
cache: true
6969
- name: Build web
70-
run: flutter build web
70+
run: flutter build web
71+
build-web-wasm:
72+
name: "Build Web WASM"
73+
runs-on: ubuntu-latest
74+
defaults:
75+
run:
76+
working-directory: example
77+
steps:
78+
- uses: actions/checkout@v4
79+
- uses: subosito/flutter-action@v2
80+
with:
81+
channel: ${{ env.FLUTTER_CHANNEL }}
82+
cache: true
83+
- name: Build web
84+
run: flutter build web --wasm

_headers

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/*
2+
Cross-Origin-Embedder-Policy: credentialless
3+
Cross-Origin-Opener-Policy: same-origin

lib/src/platform_interface.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'package:maplibre/maplibre.dart';
22
import 'package:maplibre/src/map_state.dart';
3-
import 'package:maplibre/src/native/platform_impl.dart'
4-
if (dart.library.html) 'package:maplibre/src/web/platform_impl.dart';
3+
import 'package:maplibre/src/web/platform_impl.dart'
4+
if (dart.library.io) 'package:maplibre/src/native/platform_impl.dart';
55

66
/// https://pub.dev/packages/plugin_platform_interface#a-note-about-base
77
abstract base class PlatformInterface {

lib/src/web/interop/map.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ extension type MapOptions._(JSObject _) implements JSObject {
126126
external factory MapOptions({
127127
required String style,
128128
required JSObject container,
129-
double zoom = 0,
130-
LngLat? center,
131-
double bearing = 0,
132-
double pitch = 0,
133-
bool attributionControl = true,
129+
required double zoom,
130+
required LngLat? center,
131+
required double bearing,
132+
required double pitch,
133+
required bool attributionControl,
134134
});
135135
}
136136

0 commit comments

Comments
 (0)