Created
November 10, 2021 13:31
-
-
Save NinoDLC/5afcf3ec9d77c6473f0598707c6a4cbf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package fr.delcey.pokedexfullflow | |
import android.location.Location | |
import androidx.lifecycle.LiveData | |
import kotlinx.coroutines.delay | |
import kotlinx.coroutines.flow.Flow | |
import kotlinx.coroutines.flow.flowOf | |
import kotlin.random.Random | |
class AllInOneRepository { | |
fun getLocationFlow(): Flow<Location> { | |
return flowOf() | |
} | |
fun getNearbyRestaurants(latitude: Float, longitude: Float): Flow<List<Restaurant>> { | |
return flowOf() | |
} | |
data class Restaurant( | |
val placeId: String, | |
val name: String, | |
val restaurantLatitude: Float, | |
val restaurantLongitude: Float, | |
val rating: Float // [1, 5] | |
) | |
suspend fun getGeocoderInformation( | |
latitude1: Float, longitude1: Float, | |
latitude2: Float, longitude2: Float, | |
) : Int { | |
delay(200) | |
return Random.nextInt(500) | |
} | |
// val liveData : LiveData<List<RestaurantViewState>> | |
// data class RestaurantViewState( | |
// val placeId: String, | |
// val name: String, | |
// val distance: String, | |
// val starRating: Int | |
// ) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment