map<TResult extends Object?> method
- @optionalTypeArgs
- required TResult profileViewDetailed(
- UNotificationGetGroupedNotificationsRelatedViewsProfileViewDetailed value
- required TResult blockedPost(
- UNotificationGetGroupedNotificationsRelatedViewsBlockedPost value
- required TResult generatorView(
- UNotificationGetGroupedNotificationsRelatedViewsGeneratorView value
- required TResult notFoundPost(
- UNotificationGetGroupedNotificationsRelatedViewsNotFoundPost value
- required TResult postView(
- UNotificationGetGroupedNotificationsRelatedViewsPostView value
- required TResult starterPackView(
- UNotificationGetGroupedNotificationsRelatedViewsStarterPackView value
- required TResult unknown(
- UNotificationGetGroupedNotificationsRelatedViewsUnknown 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( UNotificationGetGroupedNotificationsRelatedViewsProfileViewDetailed value) profileViewDetailed,required TResult Function( UNotificationGetGroupedNotificationsRelatedViewsBlockedPost value) blockedPost,required TResult Function( UNotificationGetGroupedNotificationsRelatedViewsGeneratorView value) generatorView,required TResult Function( UNotificationGetGroupedNotificationsRelatedViewsNotFoundPost value) notFoundPost,required TResult Function( UNotificationGetGroupedNotificationsRelatedViewsPostView value) postView,required TResult Function( UNotificationGetGroupedNotificationsRelatedViewsStarterPackView value) starterPackView,required TResult Function( UNotificationGetGroupedNotificationsRelatedViewsUnknown value) unknown,}){
final _that = this;
switch (_that) {
case UNotificationGetGroupedNotificationsRelatedViewsProfileViewDetailed():
return profileViewDetailed(_that);case UNotificationGetGroupedNotificationsRelatedViewsBlockedPost():
return blockedPost(_that);case UNotificationGetGroupedNotificationsRelatedViewsGeneratorView():
return generatorView(_that);case UNotificationGetGroupedNotificationsRelatedViewsNotFoundPost():
return notFoundPost(_that);case UNotificationGetGroupedNotificationsRelatedViewsPostView():
return postView(_that);case UNotificationGetGroupedNotificationsRelatedViewsStarterPackView():
return starterPackView(_that);case UNotificationGetGroupedNotificationsRelatedViewsUnknown():
return unknown(_that);}
}