maybeMap<TResult extends Object?> method
TResult
maybeMap<TResult extends Object?>({
- TResult live(
- StoryContentTypeLive value
- TResult photo(
- StoryContentTypePhoto value
- TResult unsupported()?,
- TResult video(
- StoryContentTypeVideo value
- required TResult orElse(),
Implementation
TResult maybeMap<TResult extends Object?>({
TResult Function(StoryContentTypeLive value)? live,
TResult Function(StoryContentTypePhoto value)? photo,
TResult Function(StoryContentTypeUnsupported value)? unsupported,
TResult Function(StoryContentTypeVideo value)? video,
required TResult Function() orElse,
}) {
switch (getConstructor()) {
case StoryContentTypeLive.constructor:
if (live != null) {
return live.call(this as StoryContentTypeLive);
}
break;
case StoryContentTypePhoto.constructor:
if (photo != null) {
return photo.call(this as StoryContentTypePhoto);
}
break;
case StoryContentTypeUnsupported.constructor:
if (unsupported != null) {
return unsupported.call(this as StoryContentTypeUnsupported);
}
break;
case StoryContentTypeVideo.constructor:
if (video != null) {
return video.call(this as StoryContentTypeVideo);
}
break;
}
return orElse.call();
}