-
Refactor the Clima app's code so that all the logic of getting the current location will be handled by a dedicated
Location
object. -
Creating a seperate
Location
class in the location.dart file. -
This class needs to have two properties: a
latitude
and alongitude
. -
The
Location
class also needs to have a method calledgetCurrentLocation()
. Move the try-catch block with the code where yougetCurrentPosition()
in the loading_screen to thegetCurrentLocation()
method. -
In the loading_screen.dart update
getLocation()
so that you 1) create a newLocation
object, 2) you call thegetCurrentLocation()
method, and 3) you print the values stored insidelatitude
andlongitude
.
Hint: Assign the values to your latitude
and longitude
properties using position.latitude
and position.longitude
.