flutter 仿喜马拉雅播放器 实现播放动画,专辑显示,音乐播放控制,下拉刷新等

https://github.com/yichuancq/flutter_himalaya.git

A new Flutter application.

Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

>播放页面

>  专辑列表

更多细节请查看GitHub

///播放控制按钮组
  Widget _playerControlBar() {
    return SizedBox(
      height: 40,
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.start,
        mainAxisAlignment: MainAxisAlignment.spaceAround,
        children: <Widget>[
          IconButton(
            icon: Icon(Icons.reorder, color: Colors.white),
            onPressed: () {
              showModalSheet();
            },
          ),

          //返回前一首
          IconButton(
            icon: Icon(Icons.skip_previous, color: Colors.white),
            onPressed: () {
              _prev();
            },
          ),
          // 播放,暂停
          IconButton(
            //判断是否播放中,返回不同按钮状态
            icon: playFlag == true
                ? Icon(Icons.pause, color: Colors.red) //暂停
                : Icon(Icons.play_arrow, color: Colors.white),
            // 播放
            onPressed: () {
              setState(() {
                controlPlay();
              });
            },
          ),
          //一下首
          IconButton(
            icon: Icon(Icons.skip_next, color: Colors.white),
            onPressed: () {
              _next();
            },
          ),

          IconButton(
            icon: Icon(Icons.timer, color: Colors.white),
            onPressed: () {
              // _showModalSheet();
            },
          ),
        ],
      ),
    );
  }

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值