maybeMap<TResult extends Object?> method
TResult
maybeMap<TResult extends Object?>({
- TResult bots(
- TopChatCategoryBots value
- TResult calls(
- TopChatCategoryCalls value
- TResult channels(
- TopChatCategoryChannels value
- TResult forwardChats()?,
- TResult groups(
- TopChatCategoryGroups value
- TResult guestBots(
- TopChatCategoryGuestBots value
- TResult inlineBots()?,
- TResult users(
- TopChatCategoryUsers value
- TResult webAppBots()?,
- required TResult orElse(),
Implementation
TResult maybeMap<TResult extends Object?>({
TResult Function(TopChatCategoryBots value)? bots,
TResult Function(TopChatCategoryCalls value)? calls,
TResult Function(TopChatCategoryChannels value)? channels,
TResult Function(TopChatCategoryForwardChats value)? forwardChats,
TResult Function(TopChatCategoryGroups value)? groups,
TResult Function(TopChatCategoryGuestBots value)? guestBots,
TResult Function(TopChatCategoryInlineBots value)? inlineBots,
TResult Function(TopChatCategoryUsers value)? users,
TResult Function(TopChatCategoryWebAppBots value)? webAppBots,
required TResult Function() orElse,
}) {
switch (getConstructor()) {
case TopChatCategoryBots.constructor:
if (bots != null) {
return bots.call(this as TopChatCategoryBots);
}
break;
case TopChatCategoryCalls.constructor:
if (calls != null) {
return calls.call(this as TopChatCategoryCalls);
}
break;
case TopChatCategoryChannels.constructor:
if (channels != null) {
return channels.call(this as TopChatCategoryChannels);
}
break;
case TopChatCategoryForwardChats.constructor:
if (forwardChats != null) {
return forwardChats.call(this as TopChatCategoryForwardChats);
}
break;
case TopChatCategoryGroups.constructor:
if (groups != null) {
return groups.call(this as TopChatCategoryGroups);
}
break;
case TopChatCategoryGuestBots.constructor:
if (guestBots != null) {
return guestBots.call(this as TopChatCategoryGuestBots);
}
break;
case TopChatCategoryInlineBots.constructor:
if (inlineBots != null) {
return inlineBots.call(this as TopChatCategoryInlineBots);
}
break;
case TopChatCategoryUsers.constructor:
if (users != null) {
return users.call(this as TopChatCategoryUsers);
}
break;
case TopChatCategoryWebAppBots.constructor:
if (webAppBots != null) {
return webAppBots.call(this as TopChatCategoryWebAppBots);
}
break;
}
return orElse.call();
}