nick92 / flutter_mapbox

Apache License 2.0
6 stars 9 forks source link

EmbeddedNavigationView null check issue #8

Open stefan-chivu opened 1 year ago

stefan-chivu commented 1 year ago

Hi, in the line mentioned below, accessing annotationApi in annotationApi.createPointAnnotationManager() without the null check operator causes a Flutter build error. I temporarily solved it like this:

s/annotationApi.createPointAnnotationManager()/annotationApi!!.createPointAnnotationManager()/

I don't have Kotlin knowledge so I don't know if this fix is safe or not.

https://github.com/nick92/flutter_mapbox/blob/99da435a7d7ca53e8c1d210c66c8a42e929901a1/android/src/main/kotlin/com/nick92/flutter_mapbox/EmbeddedNavigationView.kt#L443

flutter --version output: Flutter 3.7.12 • channel stable • https://github.com/flutter/flutter.git Framework • revision 4d9e56e694 (6 weeks ago) • 2023-04-17 21:47:46 -0400 Engine • revision 1a65d409c7 Tools • Dart 2.19.6 • DevTools 2.20.1

irjayjay commented 1 year ago

Getting the same issue. Never got it before, must be from a recent update? Weird that non null safe code was left in Kotlin for so long.

nick92 commented 1 year ago

that's interesting as I don't get an error from this at all, not sure if it's to do with a later version of either kotlin or flutter, really not sure

I've added in this null check into v0.6.1 - so let me know if it's been resolved now