onError method
Displays the errorMessage
in a snackbar of the parent widget
Implementation
onError(String errorMessage) {
ScaffoldMessenger.of(buildContext).showSnackBar(SnackBar(
content: Text(errorMessage),
action: SnackBarAction(
label: 'HIDE',
onPressed:
ScaffoldMessenger.of(buildContext).hideCurrentSnackBar)));
}