Skip to content

Commit f5e5972

Browse files
committed
Fix compile error
This commit fix the compile error when building Android apk.
1 parent 8246a84 commit f5e5972

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

example/lib/click_annotations.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,10 @@ class ClickAnnotationBodyState extends State<ClickAnnotationBody> {
8080
}
8181

8282
Future<void> _onStyleLoaded() async {
83-
await addImageFromAsset(
84-
controller!, "custom-marker", "assets/symbols/custom-marker.png");
83+
if (controller != null) {
84+
await addImageFromAsset(
85+
controller!, "custom-marker", "assets/symbols/custom-marker.png");
86+
}
8587
controller!.addCircle(
8688
const CircleOptions(
8789
geometry: LatLng(-33.881979408447314, 151.171361438502117),

example/lib/layer.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,10 @@ class LayerState extends State {
145145
controller.onFeatureTapped.add(onFeatureTap);
146146
}
147147

148-
void onFeatureTap(
149-
dynamic featureId, Point<double> point, LatLng latLng, String layerId) {
148+
void onFeatureTap(dynamic featureId, Point<double> point, LatLng latLng) {
150149
final snackBar = SnackBar(
151150
content: Text(
152-
'Tapped feature with id $featureId on layer $layerId',
151+
'Tapped feature with id $featureId on layer',
153152
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
154153
),
155154
backgroundColor: Theme.of(context).primaryColor,

example/lib/sources.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,9 @@ class FullMapState extends State<FullMap> {
308308

309309
_onStyleLoadedCallback() async {
310310
final styleInfo = _stylesAndLoaders[selectedStyleId];
311-
styleInfo.addDetails(controller!);
311+
if (controller != null) {
312+
styleInfo.addDetails(controller!);
313+
}
312314
controller!
313315
.animateCamera(CameraUpdate.newCameraPosition(styleInfo.position));
314316
}

0 commit comments

Comments
 (0)