当我尝试快速播放声音文件时,它表明“字幕控制器已设置”。 这是我的代码:
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'),
),
),
),
),
);
}
}
如何解决这个问题?
答案 0 :(得分:0)
通过更新fld sdk,我解决了这个问题。