Currently a hot-reload will cause a Java exception to be thrown on any event as the theoretically stateless class MapView is holding the state of which _textureId to interact with.
E/MethodChannel#com.mapbox/flutter_mapbox(18191): Failed to handle method call
E/MethodChannel#com.mapbox/flutter_mapbox(18191): java.lang.NullPointerException: Attempt to invoke virtual method 'long java.lang.Number.longValue()' on a null object reference
E/MethodChannel#com.mapbox/flutter_mapbox(18191): at com.mapbox.flutter.FlutterMapboxPlugin.textureIdOfCall(FlutterMapboxPlugin.java:224)
This change pulls the _textureId state up to the StatefulWidget component which will preserve _textureId state over hot-reload.
Currently a hot-reload will cause a Java exception to be thrown on any event as the theoretically stateless class MapView is holding the state of which _textureId to interact with.
E/MethodChannel#com.mapbox/flutter_mapbox(18191): Failed to handle method call E/MethodChannel#com.mapbox/flutter_mapbox(18191): java.lang.NullPointerException: Attempt to invoke virtual method 'long java.lang.Number.longValue()' on a null object reference E/MethodChannel#com.mapbox/flutter_mapbox(18191): at com.mapbox.flutter.FlutterMapboxPlugin.textureIdOfCall(FlutterMapboxPlugin.java:224)
This change pulls the _textureId state up to the StatefulWidget component which will preserve _textureId state over hot-reload.