OrderPatterns extension

Adds pattern-matching-related methods to Order.

on

Methods

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

Available on Order, provided by the OrderPatterns extension

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

Available on Order, provided by the OrderPatterns extension

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

Available on Order, provided by the OrderPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(String id, String email, String currencyCode, String customerUrl, LineItemsOrder lineItems, String name, int orderNumber, String processedAt, ShippingAddress? shippingAddress, ShippingAddress? billingAddress, String statusUrl, PriceV2 subtotalPrice, PriceV2 totalPrice, PriceV2 totalShippingPrice, PriceV2 totalTax, String financialStatus, String fulfillmentStatus, PriceV2? totalRefunded, String? phone, String? cursor, String? canceledAt, String? cancelReason, List<SuccessfulFullfilment>? successfulFulfillments)?, {required TResult orElse()}) → TResult

Available on Order, provided by the OrderPatterns extension

A variant of when that fallback to an orElse callback.
when<TResult extends Object?>(TResult $default(String id, String email, String currencyCode, String customerUrl, LineItemsOrder lineItems, String name, int orderNumber, String processedAt, ShippingAddress? shippingAddress, ShippingAddress? billingAddress, String statusUrl, PriceV2 subtotalPrice, PriceV2 totalPrice, PriceV2 totalShippingPrice, PriceV2 totalTax, String financialStatus, String fulfillmentStatus, PriceV2? totalRefunded, String? phone, String? cursor, String? canceledAt, String? cancelReason, List<SuccessfulFullfilment>? successfulFulfillments)) → TResult

Available on Order, provided by the OrderPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(String id, String email, String currencyCode, String customerUrl, LineItemsOrder lineItems, String name, int orderNumber, String processedAt, ShippingAddress? shippingAddress, ShippingAddress? billingAddress, String statusUrl, PriceV2 subtotalPrice, PriceV2 totalPrice, PriceV2 totalShippingPrice, PriceV2 totalTax, String financialStatus, String fulfillmentStatus, PriceV2? totalRefunded, String? phone, String? cursor, String? canceledAt, String? cancelReason, List<SuccessfulFullfilment>? successfulFulfillments)?) → TResult?

Available on Order, provided by the OrderPatterns extension

A variant of when that fallback to returning null