簡體   English   中英

FloatingActionButton onpressed()在flutter中不起作用

[英]FloatingActionButton onpressed() not working in flutter

當我點擊工廠時,這里發生的事情是我的代碼也許你們其中一個人可以幫忙:)

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",
                  ),

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM