onPressed method

dynamic onPressed()

Implementation

onPressed() async {
  if (text.isEmpty) {
    text = await widget.onPressed();
  } else {
    text = '';
  }
  setState(() {});
}