kotlinx.coroutines.flow.Flow
is not available with implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0'
, but is available with implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.0'
.
Is it depricated? What is alternative?
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import kotlinx.coroutines.flow.Flow
@Dao
interface WordDao {
@Query("SELECT * FROM word_table ORDER BY word ASC")
fun getAlphabetizedWords(): Flow<List<Word>>
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun insert(word: Word)
@Query("DELETE FROM word_table")
suspend fun deleteAll()
}
Kotlin Flow is not deprecated. Use the latest version of kotlinx-coroutine-android
(1.5.2): org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2
It works for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With