代码拉取完成,页面将自动刷新
Netease cloud music api for flutter ,reference https://github.com/Binaryify/NeteaseCloudMusicApi.
欢迎star、pr、issues
如果你想知道更多如何使用这个库,可以参考我的另外一个项目 ~。https://github.com/hcanyz/flutter-zmusic
添加依赖
dependencies:
netease_music_api:
git:
url: git://github.com/hcanyz/flutter-netease-music-api.git
#url: git://gitee.com/hcanyz/flutter-netease-music-api.git
使用
final success = await NeteaseMusicApi.init(debug: true);
var api = NeteaseMusicApi();
api.useSomeApi
// 登录态变化
var subscription = api.usc.listenLoginState((event, accountInfoWrap) {
switch (event) {
case LoginState.Logined:
//do some
print(accountInfoWrap);
break;
case LoginState.Logout:
//do some
break;
}
});
// dispose
subscription.cancel();
const String login_email = '';
const String login_email_password = '';
const String login_phone = '';
const String login_phone_password = '';
flutter pub run build_runner build
code | desc |
---|---|
-460 | Cheating |
-2 | 无权限访问 |
200 | ok |
201 | 已经取消关注 |
250 | 风险提示 |
301 | 需要登录 |
400 | 请求(参数异常、无效请求、业务相关) |
403 | 请求参数异常(无效) |
404 | 请求的接口不存在 |
501 | 账号不存在 |
503 | 验证码错误 |
405 | 发送验证码间隔过短 |
505 | 更新昵称被占用 |
509 | 密码错误超过限制 |
512 | 未付费歌曲无法收藏 |
250: 可能是cookie中缺少 'os':'pc'
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 2.1.0-13.0.pre.294, on Microsoft Windows [Version 10.0.19042.867], locale zh-CN)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] IntelliJ IDEA Community Edition (version 2020.3)
[√] VS Code, 64-bit edition (version 1.54.3)
[√] Connected device (1 available)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。