Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onCustomAction() parameter change #362

Closed
shimorojune opened this issue Jun 17, 2020 · 3 comments
Closed

onCustomAction() parameter change #362

shimorojune opened this issue Jun 17, 2020 · 3 comments

Comments

@shimorojune
Copy link

To which pages does your suggestion apply?

Quote the sentences(s) from the documentation to be improved (if any)
In the documentation, overriding the customAction is explained to be performed as:

@override
void onCustomAction(String name, dynamic arguments) {
    if (name == 'setVolume') {
        _audioPlayer.setVolume(arguments);
    }
}

Describe your suggestion
However, when I try to implement the same, I am facing this error which, I have never faced up until now:

AudioPlayerTask.onCustomAction' ('void Function(String, dynamic)') isn't a valid override of 'BackgroundAudioTask.onCustomAction' ('Future<dynamic> Function(String, dynamic)')

I am not sure if this is a new change or a fault at my end, and as far as I looked, this issue has not been mentioned in the Issues column yet.
So if it is a new change, please update the documentation.

Flutter doctor:
image

Package Information:
audio_service: ^0.11.0
just_audio: 0.2.0

@shimorojune
Copy link
Author

EDIT
Fixed the issue,

The function should return a Future<void> instead of void.
NOTE: Please update the documentation.

Closing issue due to solution being found.

@ryanheise
Copy link
Owner

Thanks, @Rohitrajp . I have updated the FAQ.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs, or use StackOverflow if you need help with audio_service.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants