speak method

Future<void> speak(
  1. String text
)

Speaks the given text aloud

  • Automatically stops any existing speech first
  • Updates isSpeaking flag

Implementation

Future<void> speak(String text) async {
  await stop(); // ensure no overlap
  _isSpeaking = true;
  await _tts.speak(text);
}