Added center map and fixed compile error#76
Added center map and fixed compile error#76gusrod-coder wants to merge 2 commits intomaizebus-2.1from
Conversation
Added centering for map (on app start, or directly after the user declares that they will allow location tracking) - Edited build gradle and settings gradle to remove compiling error (kotlin 2.3 instead of 2.1).
TheStaticBits
left a comment
There was a problem hiding this comment.
you've created an infinite centerOnLocation loop -- make sure to run and test your features before creating a pull request. See comments for more details
lib/screens/map_screen.dart
Outdated
| } | ||
|
|
||
| Position? position = await Geolocator.getLastKnownPosition(); | ||
| _centerOnLocation(true); |
There was a problem hiding this comment.
_centerOnLocation calls _getLastKnownLocation, creating an infinite loop.
Removed unneccessary comments and reimplemented location centering immediately after location permissions are provided to avoid infinite centering loop
|
Moved the center on location call to avoid infinite loops - Now will center once after user changes their geolocator permission from denied to allowed or on app open |
TheStaticBits
left a comment
There was a problem hiding this comment.
looks all good to me, aside from some buggy center-looping behavior when the user denies permissions -- but I think fixing the experience of using the app with location permissions denied should be another task entirely, since right now it spams the "location perms denied" banner regardless of this particular pull request. I'll approve this if @i-kumar is alright with it
|
checking it now |
There was a problem hiding this comment.
Nope. Not the behavior we want. The centering after accepting location permissions for the first time is fine. But for the normal case, make it so that the map is centered when the map is loaded. If the app loads, and then the map animates there, it looks odd.
Right now the map is set to default center on ann arbor. You'll have to change that. And you'll have to write the call to find the location in the loading sequence (in _loadAllData()).
Added centering for map (on app start, or directly after the user declares that they will allow location tracking) - Edited build gradle and settings gradle to remove compiling error (kotlin 2.3 instead of 2.1).