ifError method

void ifError(
  1. void callback(
    1. String error,
    2. String message
    )
)

Pattern-match helper — only handle error.

Implementation

void ifError(void Function(String error, String message) callback) {
  if (this case ApiError<T> e) callback(e.error, e.message);
}