here’s a screenshot of the code
the code was running well before my current position was printing on the console then I terminated the program and ran it again then it just stopped working
here’s a screenshot of the code
the code was running well before my current position was printing on the console then I terminated the program and ran it again then it just stopped working
2
Answers
Firstly, you need to decare your position variable outside the function block to be able to access it within your build Widgets.
Next, you need to update the position state using
setState
;For any more help or explanation feel free to comment below. Bye!
The official documentation is cleared and detailed. You can consult this link geolocator, It’s shows the steps to be followed during the implementation of get the current location.
permissions are granted .
The following code, it’s copied from official documentation: