开发者

Too many positional arguments: 0 expected, but 1 found. flutter

i have a methode that loaded me the data from server on Json format data , also im using audioPlayer library to play music got it from server , when i want to pass the path inside audioPlayer.play like that :

String Url = _loadedAudio[index]['file'];
await audioPlayer.play(Url);

it display to me this开发者_开发问答 error :

Too many positional arguments: 0 expected, but 1 found.

how can i solve it


You can try these two options:

await player.setSourceUrl(Url);
await player.resume();

Or

await player.play(UrlSource(Url));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜