Closed gOzaru closed 3 years ago
BehaviorSubject is part of rxdart, which audio_service uses. Are you using rxdart in your project already? There might be a conflict (that could be solved by using the same version of rxdart).
No, I haven't used any rxdart at all. Maybe I will try to add one version of rxdart.
Okay, now it works for all of them. I just need to add null check (!) after value. It seems I need to import rxdart.dart first in audio_handler.dart. Thank you once again for your help, suragch. God bless you. May you always be healthy and wealthy.
What version of audio_service are you using in pubspec.yaml? I had to had the ! In previous version but not in the most recent version.
audio_service: ^0.18.0-beta.0
The same one as written in your project.yaml
I used Flutter 2.2.2.
Ok, that's strange then that value is nullable in your project but not in mine. My last guess would be to double check pubspec.lock.
I think some of them were lost when cleaning the project, especially image. Probably that was the cause?
I'm not sure. Let me know if you ever figure it out.
I used to leave it as empty for GetX version in pubspec.yaml. But today, I felt I had to add one in GetX. After I updated the GetX to the latest in pubspec.yaml, the errors show up in all null checks I put earlier. It forced me to remove all of them. After I removed them, there are no errors. Strange.
Hello suragch. I tested your final project and it works and no error at all. But unfortunately when I imported your project into my project, there are errors everywhere especially the one with value. Like this file: audio_handler.dart lines 39 (Error on value)
The error says: "The getter 'value' isn't defined for the type 'BehaviorSubject'.
Try importing the library that defines 'value', correcting the name to the name of an existing getter, or defining a getter or field named 'value'."
I had done "Project Clean", but nothing happen. It still gives same error. I don't change any of your codes yet.
Any clue why this happen?