GenericResponsePatterns<T> extension
Adds pattern-matching-related methods to GenericResponse.
- on
Methods
-
map<
TResult extends Object?> (TResult $default(_GenericResponse< T> value)) → TResult -
Available on GenericResponse<
AT> , provided by the GenericResponsePatterns extensionswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_GenericResponse< T> value)?) → TResult? -
Available on GenericResponse<
A variant ofT> , provided by the GenericResponsePatterns extensionmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> (TResult $default(_GenericResponse< T> value)?, {required TResult orElse()}) → TResult -
Available on GenericResponse<
A variant ofT> , provided by the GenericResponsePatterns extensionmapthat fallback to returningorElse. -
maybeWhen<
TResult extends Object?> (TResult $default(String requestId, int timestamp, bool success, T data, ErrorResponse? error)?, {required TResult orElse()}) → TResult -
Available on GenericResponse<
A variant ofT> , provided by the GenericResponsePatterns extensionwhenthat fallback to anorElsecallback. -
when<
TResult extends Object?> (TResult $default(String requestId, int timestamp, bool success, T data, ErrorResponse? error)) → TResult -
Available on GenericResponse<
AT> , provided by the GenericResponsePatterns extensionswitch-like method, using callbacks. -
whenOrNull<
TResult extends Object?> (TResult? $default(String requestId, int timestamp, bool success, T data, ErrorResponse? error)?) → TResult? -
Available on GenericResponse<
A variant ofT> , provided by the GenericResponsePatterns extensionwhenthat fallback to returningnull