Closed ydhnwb closed 10 months ago
You need to manually add the model to hilt graph like below
@Module
@InstallIn(ActivityComponent::class)
@Suppress("UNUSED")
abstract class ListScreenModule {
@Binds
@IntoMap
@ScreenModelKey(ListScreenModel::class)
abstract fun ListScreenModel.binds(): ScreenModel
}
I have a simple module like this:
And NoteDataSource will be injected to ListScreenModel like this:
Using it inside AndroidScreen() via getScreenModel like this:
But it returns error like:
I already added @HiltAndroidApp and @AndroidEntryPoint. Am I missing something or this is a bug?