Reputation: 458
The argument type 'String?' can't be assigned to the parameter type 'String' i got this error but previously the code was working fine. i have seen people raising the same issue but am not understanding the root cause. the package am using is flutter_audio_query nullsafe version from github. can someone help me with the issue.
Upvotes: 2
Views: 113
Reputation: 3189
String? which is nullable and you cannot pass directly to the non-null fields. So use like this,
await player.setUrl(songInfo.uri ?? ''); // if null then empty string will be passed.
or
await player.setUrl(songInfo.uri!); // this is you saying that it won't be null.
Upvotes: 1