coroutine Flow : Not sure how to convert a Cursor to this method’s return type

Do not use both suspend and Flow<> on the same method! Like this

 @Query("SELECT * FROM user")
    suspend fun loadAll(): Flow<Array<User>>

Just

@Query("SELECT * FROM user")
    suspend fun loadAll(): Array<User>

OR

@Query("SELECT * FROM user")
   fun loadAll(): Flow<Array<User>>

Leave a Comment