medito-app
medito-app copied to clipboard
Trying to download a Background Sound with no connection
When you're downloading a background sound, if there is a slow connection or no connection, at the moment, an Exception is thrown but the UI doesn't respond. We should have a snackbar or something to indicate the error, and cancel the loading spinner
[branch: develop]
mmm I think we shouldn't display the background sounds that aren't available instead?
Relevant file: lib/widgets/player/background_sounds_sheet_widget.dart
Line 182:
Right now it shows the list of all background sounds and caches the list. When you click on one, it downloads the mp3.
For better offline functionality, we would need to save a list of the files that are downloaded, and only show that list if there is no connectivity.
We can check the connectivity with await (Connectivity().checkConnectivity());
It might be good to use this in conjunction with a FutureBuilder
I'll give this issue a try!
Awesome! Thanks @jthure ! :)
hey @jthure, how is it going?
hey @jthure, how is it going?
I was hit by a massive workload at work, so I haven't had much time to spare, but I've looked into it and have a solution in mind. I'll get a pr submitted shortly :)
Hey @jthure , all good?
Sorry about my radio silence. Got occupied by other stuff and didn't get chance to finish it. I'll un-assign myself for now and get back to it when get a chance if it is still available
I'll take a look at this!
Just to check if I've understood this correctly:
CASE 1: No connectivity as the app is opened - show the cached list of already downloaded background sounds or an empty list
CASE 2: There was connectivity when the app is opened but by the time the user starts the meditation, they lose connectivity - show the cached list of already downloaded background sounds or an empty list (same as case 1)
CASE 3: They lose connectivity while downloading a background sound (and the spinner keeps rotating as of now) - what would be the expected behavior here?
I'll start working on case 1 & 2 in the meanwhile, if there's anything there, please let me know!
Awesome! Thank you @harshadmanglani ! The 3 cases are exactly right !
@scouech so the spinner needs to stop rotating and a snackbar should come up for case 3 right?
Yep, i think it makes sense? Might be the easiest
Yes okay, understood!! Yeah, does seem like it'll be easy :)
A quick update: I'm done with all 3 cases, I'm working on fixing a few bugs with the AudioService
As we massively changed the app I'm closing this as it's not entirely relevant anymore