if a user presses a button too fast by navigation screens, the error can appear.
my solution was to disable the button after the first press
bool buttonsafe = true
...
onPressed: buttonsafe ? _submit : null,
...
_submit:
setState(() {
buttonsafe = false;
});