Google maps new map center

Actions & Logic

In the google map widget I added a button to set the new map center to the current device location and another button to center the map to a new given LatLng which is saved as an app state but when I try to run both of the actions I get this error

TypeError: Cannot read properties of null (reading 'Ws')

From whats happening I understand that once I set an initial location for the widget I can never change it, I am not an expertise but it seems that I am facing a limitation from the FF widgets/actions itself but it might be fixed if I used a custom action, if someone could confirm this I will be very grateful, because I am stuck with this issue for days now.

What have you tried so far?

I saved the LatLng as a component state but didn't work.

To make sure that the value is actually saved in an app state/component state I displayed the LatLng as a text under the button to see if the value is actually is null or not, same goes for the device location, all the value were there and they are valid, and also to assure that I have used the google maps api (after converting the LatLng to string to pass it as a variable) to display the address of those coordination to make sure that I have the correct format, I tried to pass the string value to the google maps widget but it only accepts the LatLng datatype.

Edit:

I tried to change the variable from current device location to read from a document field "location" containing a constant LatLng value still no use...

Did you check FlutterFlow's Documentation for this topic?
Yes
1
7 replies