map<TResult extends Object?> method

TResult map<TResult extends Object?>({
  1. required TResult users(
    1. TopChatCategoryUsers value
    ),
  2. required TResult bots(
    1. TopChatCategoryBots value
    ),
  3. required TResult groups(
    1. TopChatCategoryGroups value
    ),
  4. required TResult channels(
    1. TopChatCategoryChannels value
    ),
  5. required TResult inlineBots(
    1. TopChatCategoryInlineBots value
    ),
  6. required TResult guestBots(
    1. TopChatCategoryGuestBots value
    ),
  7. required TResult webAppBots(
    1. TopChatCategoryWebAppBots value
    ),
  8. required TResult calls(
    1. TopChatCategoryCalls value
    ),
  9. required TResult forwardChats(
    1. TopChatCategoryForwardChats value
    ),
})

Implementation

TResult map<TResult extends Object?>({
  required TResult Function(TopChatCategoryUsers value) users,
  required TResult Function(TopChatCategoryBots value) bots,
  required TResult Function(TopChatCategoryGroups value) groups,
  required TResult Function(TopChatCategoryChannels value) channels,
  required TResult Function(TopChatCategoryInlineBots value) inlineBots,
  required TResult Function(TopChatCategoryGuestBots value) guestBots,
  required TResult Function(TopChatCategoryWebAppBots value) webAppBots,
  required TResult Function(TopChatCategoryCalls value) calls,
  required TResult Function(TopChatCategoryForwardChats value) forwardChats,
}) {
  switch (getConstructor()) {
    case TopChatCategoryUsers.constructor:
      return users.call(this as TopChatCategoryUsers);
    case TopChatCategoryBots.constructor:
      return bots.call(this as TopChatCategoryBots);
    case TopChatCategoryGroups.constructor:
      return groups.call(this as TopChatCategoryGroups);
    case TopChatCategoryChannels.constructor:
      return channels.call(this as TopChatCategoryChannels);
    case TopChatCategoryInlineBots.constructor:
      return inlineBots.call(this as TopChatCategoryInlineBots);
    case TopChatCategoryGuestBots.constructor:
      return guestBots.call(this as TopChatCategoryGuestBots);
    case TopChatCategoryWebAppBots.constructor:
      return webAppBots.call(this as TopChatCategoryWebAppBots);
    case TopChatCategoryCalls.constructor:
      return calls.call(this as TopChatCategoryCalls);
    case TopChatCategoryForwardChats.constructor:
      return forwardChats.call(this as TopChatCategoryForwardChats);
  }
  throw StateError('not handled type Generator');
}