FlutterTtsPlugin constructor

FlutterTtsPlugin()

Implementation

FlutterTtsPlugin() {
  try {
    utterance = js.JsObject(
        js.context["SpeechSynthesisUtterance"] as js.JsFunction, [""]);
    synth = js.JsObject.fromBrowserObject(
        js.context["speechSynthesis"] as js.JsObject);
    _listeners();
    supported = true;
  } catch (e) {
    print('Initialization of TTS failed. Functions are disabled. Error: $e');
  }
}