TranslationBatchResponsePatterns extension

Adds pattern-matching-related methods to TranslationBatchResponse.

on

Methods

map<TResult extends Object?>(TResult $default(_TranslationBatchResponse value)) → TResult

Available on TranslationBatchResponse, provided by the TranslationBatchResponsePatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_TranslationBatchResponse value)?) → TResult?

Available on TranslationBatchResponse, provided by the TranslationBatchResponsePatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_TranslationBatchResponse value)?, {required TResult orElse()}) → TResult

Available on TranslationBatchResponse, provided by the TranslationBatchResponsePatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(List<BatchTranslationResult> translations, int total, int successful, int failed)?, {required TResult orElse()}) → TResult

Available on TranslationBatchResponse, provided by the TranslationBatchResponsePatterns extension

A variant of when that fallback to an orElse callback.
when<TResult extends Object?>(TResult $default(List<BatchTranslationResult> translations, int total, int successful, int failed)) → TResult

Available on TranslationBatchResponse, provided by the TranslationBatchResponsePatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(List<BatchTranslationResult> translations, int total, int successful, int failed)?) → TResult?

Available on TranslationBatchResponse, provided by the TranslationBatchResponsePatterns extension

A variant of when that fallback to returning null