Welcome back.
We created the Location Repository and Location Repository implementation.
Now let's move to the third step which is the map view model.
Go up inside the constructor.
Pass the location repository private file location repository.
It's of type location repository.
Now let's make use of this location repository in order to get the current location.
Scroll down and here let me create new variables in order to get the current location from the repository.
Val user location equals to location repository dot user location and val has location permission equals
to location repository dot has location permission.
We are fetching the variables from the repository.
Now let's call the other functions from this location repository function start location updates.
This is very simple location repository, dot start location updates and the function stop location
updates.
Or you can override the on cleared.
So on cleared go and set the location repository dot stop location updates.
Okay, now we can handle permission result from activity.
So for example function on permission result if it is granted has location permission dot value equals
to granted.
Then if granted go and start location updates.
You can make it as a type safe or uh like for safety.
So instead of using requires permission you can call on permission result.
Okay.
This is for the A view model.
Now let's move to the user clone map and display the current location as a marker in blue.