cancel method

  1. @override
Future<void> cancel()
override

Cancels the current listen for speech if active, does nothing if not.

Canceling means that there will be no final result returned from the recognizer. Each listen session should be ended with either stop or cancel, for example in the dispose method of a Widget. cancel is automatically invoked by a permanent error if cancelOnError is set to true in the listen call.

Note Cannot be used until a successful initialize call. Should only be used after a successful listen call.

Implementation

@override
Future<void> cancel() async {
  if (null == _webSpeech) return;
  _webSpeech!.abort();
}