gpt4 book ai didi

android - FloatingActionButton onpressed()无法正常工作

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:10:12 24 4
gpt4 key购买 nike

当我点击 fab 时没有任何反应这是我的代码,也许你们中的一个可以提供帮助:)

void initSpeechRecognizer(){
_speechRecognition = SpeechRecognition
FloatingActionButton(
child: Icon(Icons.mic),
onPressed: (){
if(_isAvailable && !_isListening) _speechRecognition.listen(locale: "id_ID").then((result) => print('result : $result'));
},
heroTag: "mic",
),

最佳答案

你能试试这个吗;

void initSpeechRecognizer(){
_speechRecognition = SpeechRecognition
FloatingActionButton(
child: Icon(Icons.mic),
onPressed: () async {
if(_isAvailable && !_isListening){
var result = await _speechRecognition.listen(locale: "id_ID");
print('result : $result');
}
},
heroTag: "mic",
),

关于android - FloatingActionButton onpressed()无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57704825/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com