ifSuccess method
Pattern-match helper — only handle success, ignore error.
Implementation
void ifSuccess(void Function(T? data, String message) callback) {
if (this case ApiSuccess<T> s) callback(s.data, s.message);
}
Pattern-match helper — only handle success, ignore error.
void ifSuccess(void Function(T? data, String message) callback) {
if (this case ApiSuccess<T> s) callback(s.data, s.message);
}