Код: Выделить всё
@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () async {
await _stop(); // Stop the speech when the back button is pressed
return true;
},
child: Scaffold (...),
);
}

Я пробовал, но обнаружил ошибки.
Подробнее здесь: https://stackoverflow.com/questions/785 ... nt-be-used
Мобильная версия