map<TResult extends Object?> method

  1. @optionalTypeArgs
TResult map<TResult extends Object?>({
  1. required TResult embedGalleryImage(
    1. UEmbedGalleryItemsEmbedGalleryImage value
    ),
  2. required TResult unknown(
    1. 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);}
}