i created my useCase and setup input and output and then provide it on module and everything works fine.
class GetProfileUseCase constructor(
private val repository: Repository,
defaultDispatcher: CoroutineDispatcher
) : SuspendUseCase<Request, ResultEntity<Response>>(defaultDispatcher) {
override suspend fun execute(parameters: Request): ResultEntity<Response> {
return repository.getProfile(parameters)
}
}
and here is my data class
sealed class GetProfile : Serializable {
data class Request(
val nothing: Nothing? = null
) : GetProfile()
data class Response(
val user: User? = User()
) : GetProfile()
}
because there is no parameter in Request class i tried changed it to :
object Request
but when build it IDE error :
error: method create in class ViewModel_Factory cannot be applied to given types;
and here is my view model :
class ViewModel @Inject constructor(
private val getProfileUseCase: GetProfileUseCase
) : BaseViewModel()
i don't know why it happen and dagger couldn't generate classes !!!
it works without no error when set Request as data class but crash when make it object class