Im trying to setup a text to speech function and I've added the flutter tts dependency and the custom action with code below, but when I assign the code to a button, it doesnt do anything. Fairly new to coding so any help is appreciated.
import 'package:flutter_tts/flutter_tts.dart';
Future speakText(String text) async {
FlutterTts flutterTts = FlutterTts();
await flutterTts.setLanguage("en-US");
await flutterTts.setPitch(1.0);
await flutterTts.speak(text);
text = "hello";
}