So, I am using workmanager to retrieve data from an FTP server. I have to display one type or information or another type deppending on the state of the worker.
I was using getWorkInfoByIdLiveData on the viewmodel and I was observing the state of the worker on the activity. But, as the Observer is almost deprecated I am trying to use Flow instead.
The problem that I have is that I don't know why, I can't use the asStateFlow() on the livedata. enter image description here
Does anyone know a way to observe the state of a worker without using LiveData and Observer?
Thank youuu