bool _isButtonDisabled;
@override initState() {
super.initState();
_isButtonDisabled = false;
......
Function _counterButtonPress() {
if (_isButtonDisabled) {
return null;
} else {
return () {
_handleAccept();
setState(() {
_answered = ("Соединение...");
});
};
}
}
basicActions.add(ActionButton(
title: "Ответить",
icon:
Icons.phone,
fillColor:
Colors.green,
onPressed: _isButtonDisabled ? null : _counterButtonPress()));
Пытаюсь сделать так,что бы после нажатия на кнопку - кнопка стала не активна,но если быстро дрюкать кнопку,то судя по всему такая защита выглядит как калитка в поле. Какие есть еще варианты? ))