

This error is in the example code for the google_maps_flutter plugin, in the map_ui file. Almost all of the buttons on this page present the error "The getter 'bearing' was called on null". This is because the building method tries to access the bearing property of the _position variable, but this is set to null by the code at line 59:
https://github.com/flutter/plugins/blob/d451cac0867a9fb8db055dde1785ea599d68db7c/packages/google_maps_flutter/example/lib/map_ui.dart#L57-L61
It seems mapController.cameraPosition is being set to null at some point after the GoogleMapOptions are updated. This error can be fixed by setting _position equal to mapController.options.cameraPosition instead, since this is not null when this function runs.
This error is in the example code for the google_maps_flutter plugin, in the map_ui file. Almost all of the buttons on this page present the error
"The getter 'bearing' was called on null". This is because the building method tries to access thebearingproperty of the_positionvariable, but this is set to null by the code at line 59:https://github.com/flutter/plugins/blob/d451cac0867a9fb8db055dde1785ea599d68db7c/packages/google_maps_flutter/example/lib/map_ui.dart#L57-L61
It seems
mapController.cameraPositionis being set to null at some point after the GoogleMapOptions are updated. This error can be fixed by setting_positionequal tomapController.options.cameraPositioninstead, since this is not null when this function runs.