Skip to content

Instantly share code, notes, and snippets.

@barbeau
Last active August 13, 2021 21:45
Show Gist options
  • Save barbeau/3667d1cc3b12e263d9b3f5a6485c26cb to your computer and use it in GitHub Desktop.
Save barbeau/3667d1cc3b12e263d9b3f5a6485c26cb to your computer and use it in GitHub Desktop.
Flow - lightweight architecture article - app build.gradle
..
// New plugins for Hilt
apply plugin: 'kotlin-kapt'
apply plugin: 'dagger.hilt.android.plugin'
...
dependencies {
...
// To observe the flow within the Service based on the lifecycle
def lifecycle_version = "2.4.0-alpha01"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-service:$lifecycle_version"
// To use trySend() instead of offer() in callbackFlow (see https://github.com/Kotlin/kotlinx.coroutines/issues/974)
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.1'
// Hilt for dependency injection
implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "com.google.dagger:hilt-compiler:$hilt_version"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment