Following the dagger documentation here
What you can do is using the @AssistedInject annotation and create a factory to be used.
class CustomClass @AssisgtedInject constructor (
val repository: Repository,
@Assisted val name: String
) {
@AssistedFactory
interface CustomClassFactory {
fun create(name: String): CustomClass
}
}
Then you can have the @Inject CustomClassFactory and call the CustomClassFactory.create() to create your object.