speechToTextInstance property

dynamic speechToTextInstance
final

This property allows to enable the voice search.

Flutter searchbox uses the speech_to_text library to integrate the voice search. speech_to_text recommends to create a global instance of the SpeechToTextProvider class so we allow to pass an existing/new instance to SearchBox widget. For example,

import 'package:speech_to_text/speech_to_text.dart' as stt;
import 'package:speech_to_text/speech_to_text_provider.dart' as stp;

// Create the instance at top of your application.
final stp.SpeechToTextProvider speechToTextInstance =
stp.SpeechToTextProvider(stt.SpeechToText());

// Pass it like other properties
SearchBox(
  speechToTextInstance: speechToTextInstance
)

Implementation

final dynamic speechToTextInstance;