Add setFallbackArt to specify default art - #992
Conversation
Hmm.. The primary reason the API is currently like this is because I need to be able to update the art dynamically. I considered options like 1, 2 and 4, but they don't allow this. Although, I never thought of the 3rd one, which also allows this and looks much better. Thanks for suggesting it :-) I will try to make this working, for now I'll leave this PR as a draft. |
|
But Option 4 (like cached_network_image) can handle your use case as well, because it's a callback function. In the implementation of that function, you can dynamically adjust your desired behaviour. |
|
@nt4f04uNd |
Adds
AudioService.setFallbackArtthat automatically loads arts for all platforms using the existing refactored dart code.Also fixes a bug with
loadThumbnailUriwhere it was never used, which became obvious from another necessary change - reporting all errors from the native side to dart, to be able to fallback to default art.Tested only on Android for now, this will need to be tested on other platforms
Fixes #666
Fixes #309
I wrote this PR because I needed this in my app. You can see how I'm using this API there if you want, there's also a video nt4f04uNd/sweyer#80
Record_2023-01-22-01-01-47.mp4
Pre-launch Checklist
minorbranch OR my change is breaking and lands inmajorbranch.pubspec.yamlaccording to the pub versioning philosophy.* DESCRIPTION OF YOUR CHANGE (@your-git-username)).///).dart analyze.dart format.flutter testand all tests are passing.