如何解决错误“已设置字幕控制器”?

时间:2019-09-25 13:38:56

标签: audio flutter audio-player

当我尝试快速播放声音文件时,它表明“字幕控制器已设置”。 这是我的代码:

import 'package:flutter/material.dart';
import 'package:audioplayers/audio_cache.dart';


void main() => runApp(XylophoneApp());

class XylophoneApp extends StatelessWidget {

  final player = AudioCache();
  static AudioCache playr = AudioCache();


  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: SafeArea(
          child: Center(
            child: FlatButton(onPressed: (){
              print('clicked');
              player.play('note2.wav');
            },color: Colors.blue,
              child: Text('click me'),
            ),
          ),
        ),
      ),
    );
  }
}

如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

通过更新fld sdk,我解决了这个问题。