setErrorCallback method

dynamic setErrorCallback(
  1. void onError(
    1. String error
    )
)

Register a callback function to be called when errors occured in any function in this package.

{onError} is a function that takes a String which is the error message.

Implementation

setErrorCallback(void Function(String error) onError) {
  if (error.hasListener) {
    error = StreamController();
  }
  error.stream.listen(onError);
}