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

The argument type 'Stream<SequenceState?>' can't be assigned to the parameter type 'Stream<SequenceState>? #4

Open
Helyanti opened this issue Apr 27, 2022 · 1 comment

Comments

@Helyanti
Copy link

The following code stream: audioPlayer.sequenceStateStream, in PlayerButtons doesn't work.
I am getting this error: The argument type 'Stream<SequenceState?>' can't be assigned to the parameter type 'Stream<SequenceState>?'

StreamBuilder<SequenceState>( stream: audioPlayer.sequenceStateStream, builder: (_, __) { return _previousButton(); }, ),
StreamBuilder<SequenceState>( stream: audioPlayer.sequenceStateStream, builder: (_, __) { return _nextButton(); }, ),

@mvolpato
Copy link
Owner

mvolpato commented Apr 27, 2022

Hi @Helyanti,

The code is a year old, the package has had some changes.

To get it working you could fix the packages' versions, but I would not recommend that.

You can fix the code by changing the type of the stream builder to StreamBuilder<SequenceState?>, handling the null case in the bodies of the builder functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants