package com.isidroid.location.repository

import android.content.Context
import com.google.android.gms.location.LocationServices
import com.google.android.gms.tasks.Tasks
import com.isidroid.location.repository.LocationRepository

class LocationRepositoryImpl(private val context: Context) : LocationRepository {
    override fun getCurrentLocation(): Pair<Double, Double> {
        val client = LocationServices.getFusedLocationProviderClient(context)

        return with(Tasks.await(client.lastLocation)) {
            Pair(latitude, longitude)
        }
    }
}