map<TResult extends Object?> method
- @optionalTypeArgs
- required TResult embedGalleryImage(
- UEmbedGalleryItemsEmbedGalleryImage value
- required TResult unknown(
- UEmbedGalleryItemsUnknown value
A switch-like method, using callbacks.
Callbacks receives the raw object, upcasted. It is equivalent to doing:
switch (sealedClass) {
case final Subclass value:
return ...;
case final Subclass2 value:
return ...;
}
Implementation
@optionalTypeArgs TResult map<TResult extends Object?>({required TResult Function( UEmbedGalleryItemsEmbedGalleryImage value) embedGalleryImage,required TResult Function( UEmbedGalleryItemsUnknown value) unknown,}){
final _that = this;
switch (_that) {
case UEmbedGalleryItemsEmbedGalleryImage():
return embedGalleryImage(_that);case UEmbedGalleryItemsUnknown():
return unknown(_that);}
}