SdmIngredientPatterns extension
Adds pattern-matching-related methods to SdmIngredient.
Methods
-
map<
TResult extends Object?> (TResult $default(_SdmIngredient value)) → TResult -
Available on SdmIngredient, provided by the SdmIngredientPatterns extension
Aswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_SdmIngredient value)?) → TResult? -
Available on SdmIngredient, provided by the SdmIngredientPatterns extension
A variant ofmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> (TResult $default(_SdmIngredient value)?, {required TResult orElse()}) → TResult -
Available on SdmIngredient, provided by the SdmIngredientPatterns extension
A variant ofmapthat fallback to returningorElse. -
maybeWhen<
TResult extends Object?> (TResult $default(String id, String name, String code, double? pricePerKg, double? dryFactor, bool? priceByDry, bool? isArchived, String? sourceId, Device? source, DateTime? createdAt, User? createdBy, DateTime? updatedAt, User? updatedBy)?, {required TResult orElse()}) → TResult -
Available on SdmIngredient, provided by the SdmIngredientPatterns extension
A variant ofwhenthat fallback to anorElsecallback. -
when<
TResult extends Object?> (TResult $default(String id, String name, String code, double? pricePerKg, double? dryFactor, bool? priceByDry, bool? isArchived, String? sourceId, Device? source, DateTime? createdAt, User? createdBy, DateTime? updatedAt, User? updatedBy)) → TResult -
Available on SdmIngredient, provided by the SdmIngredientPatterns extension
Aswitch-like method, using callbacks. -
whenOrNull<
TResult extends Object?> (TResult? $default(String id, String name, String code, double? pricePerKg, double? dryFactor, bool? priceByDry, bool? isArchived, String? sourceId, Device? source, DateTime? createdAt, User? createdBy, DateTime? updatedAt, User? updatedBy)?) → TResult? -
Available on SdmIngredient, provided by the SdmIngredientPatterns extension
A variant ofwhenthat fallback to returningnull