maybeMap<TResult extends Object?> method
TResult
maybeMap<TResult extends Object?>({
- TResult allChatAdministrators()?,
- TResult allGroupChats()?,
- TResult allPrivateChats()?,
- TResult chat(
- BotCommandScopeChat value
- TResult chatAdministrators()?,
- TResult chatMember()?,
- TResult $default(
- BotCommandScopeDefault value
- required TResult orElse(),
Implementation
TResult maybeMap<TResult extends Object?>({
TResult Function(BotCommandScopeAllChatAdministrators value)?
allChatAdministrators,
TResult Function(BotCommandScopeAllGroupChats value)? allGroupChats,
TResult Function(BotCommandScopeAllPrivateChats value)? allPrivateChats,
TResult Function(BotCommandScopeChat value)? chat,
TResult Function(BotCommandScopeChatAdministrators value)?
chatAdministrators,
TResult Function(BotCommandScopeChatMember value)? chatMember,
TResult Function(BotCommandScopeDefault value)? $default,
required TResult Function() orElse,
}) {
switch (getConstructor()) {
case BotCommandScopeAllChatAdministrators.constructor:
if (allChatAdministrators != null) {
return allChatAdministrators.call(
this as BotCommandScopeAllChatAdministrators,
);
}
break;
case BotCommandScopeAllGroupChats.constructor:
if (allGroupChats != null) {
return allGroupChats.call(this as BotCommandScopeAllGroupChats);
}
break;
case BotCommandScopeAllPrivateChats.constructor:
if (allPrivateChats != null) {
return allPrivateChats.call(this as BotCommandScopeAllPrivateChats);
}
break;
case BotCommandScopeChat.constructor:
if (chat != null) {
return chat.call(this as BotCommandScopeChat);
}
break;
case BotCommandScopeChatAdministrators.constructor:
if (chatAdministrators != null) {
return chatAdministrators.call(
this as BotCommandScopeChatAdministrators,
);
}
break;
case BotCommandScopeChatMember.constructor:
if (chatMember != null) {
return chatMember.call(this as BotCommandScopeChatMember);
}
break;
case BotCommandScopeDefault.constructor:
if ($default != null) {
return $default.call(this as BotCommandScopeDefault);
}
break;
}
return orElse.call();
}