https://kotlinlang.org logo
#coroutines
Title
# coroutines
s

Sam

07/09/2020, 9:03 AM
Hello everyone, I have problem with Coroutine - Flow and retrofit Does anyone know why Coroutine doesn’t work with QueryMap? Thanks.
Copy code
Not Work:

@GET("/users")
    suspend fun getUsers(
            @QueryMap params:Map<String,Any>): BaseResponse<List<UserDto>>


Worked: 
@GET("/users")
    suspend fun getUsers(
            @Query("lat") lat:Double,
            @Query("long") lon:Double,
            @Query("genders")genders: String,
            @Query("age_max") ageMax:Int,
            @Query("age_min") ageMin:Int
    ): BaseResponse<List<UserDto>>
My Repository implement:
Copy code
fun search(params:Map<String,Any>) = flow {
        emit(service.getMatchedUsers(params
        ).data.map {
            it.mapToDomainModel() }.toList())
    }
l

louiscad

07/09/2020, 9:16 AM
You'd have more luck in #squarelibraries
🎉 1
s

Sam

07/09/2020, 9:17 AM
Thanks.
j

julian

07/09/2020, 1:59 PM
🎉 1
7 Views