map<TResult extends Object?> method

TResult map<TResult extends Object?>({
  1. required TResult allowAll(
    1. UserPrivacySettingRuleAllowAll value
    ),
  2. required TResult allowContacts(
    1. UserPrivacySettingRuleAllowContacts value
    ),
  3. required TResult allowBots(
    1. UserPrivacySettingRuleAllowBots value
    ),
  4. required TResult allowPremiumUsers(
    1. UserPrivacySettingRuleAllowPremiumUsers value
    ),
  5. required TResult allowUsers(
    1. UserPrivacySettingRuleAllowUsers value
    ),
  6. required TResult allowChatMembers(
    1. UserPrivacySettingRuleAllowChatMembers value
    ),
  7. required TResult restrictAll(
    1. UserPrivacySettingRuleRestrictAll value
    ),
  8. required TResult restrictContacts(
    1. UserPrivacySettingRuleRestrictContacts value
    ),
  9. required TResult restrictBots(
    1. UserPrivacySettingRuleRestrictBots value
    ),
  10. required TResult restrictUsers(
    1. UserPrivacySettingRuleRestrictUsers value
    ),
  11. required TResult restrictChatMembers(
    1. UserPrivacySettingRuleRestrictChatMembers value
    ),
})

Implementation

TResult map<TResult extends Object?>({
  required TResult Function(UserPrivacySettingRuleAllowAll value) allowAll,
  required TResult Function(UserPrivacySettingRuleAllowContacts value)
      allowContacts,
  required TResult Function(UserPrivacySettingRuleAllowBots value) allowBots,
  required TResult Function(UserPrivacySettingRuleAllowPremiumUsers value)
      allowPremiumUsers,
  required TResult Function(UserPrivacySettingRuleAllowUsers value)
      allowUsers,
  required TResult Function(UserPrivacySettingRuleAllowChatMembers value)
      allowChatMembers,
  required TResult Function(UserPrivacySettingRuleRestrictAll value)
      restrictAll,
  required TResult Function(UserPrivacySettingRuleRestrictContacts value)
      restrictContacts,
  required TResult Function(UserPrivacySettingRuleRestrictBots value)
      restrictBots,
  required TResult Function(UserPrivacySettingRuleRestrictUsers value)
      restrictUsers,
  required TResult Function(UserPrivacySettingRuleRestrictChatMembers value)
      restrictChatMembers,
}) {
  switch (getConstructor()) {
    case UserPrivacySettingRuleAllowAll.constructor:
      return allowAll.call(this as UserPrivacySettingRuleAllowAll);
    case UserPrivacySettingRuleAllowContacts.constructor:
      return allowContacts.call(this as UserPrivacySettingRuleAllowContacts);
    case UserPrivacySettingRuleAllowBots.constructor:
      return allowBots.call(this as UserPrivacySettingRuleAllowBots);
    case UserPrivacySettingRuleAllowPremiumUsers.constructor:
      return allowPremiumUsers
          .call(this as UserPrivacySettingRuleAllowPremiumUsers);
    case UserPrivacySettingRuleAllowUsers.constructor:
      return allowUsers.call(this as UserPrivacySettingRuleAllowUsers);
    case UserPrivacySettingRuleAllowChatMembers.constructor:
      return allowChatMembers
          .call(this as UserPrivacySettingRuleAllowChatMembers);
    case UserPrivacySettingRuleRestrictAll.constructor:
      return restrictAll.call(this as UserPrivacySettingRuleRestrictAll);
    case UserPrivacySettingRuleRestrictContacts.constructor:
      return restrictContacts
          .call(this as UserPrivacySettingRuleRestrictContacts);
    case UserPrivacySettingRuleRestrictBots.constructor:
      return restrictBots.call(this as UserPrivacySettingRuleRestrictBots);
    case UserPrivacySettingRuleRestrictUsers.constructor:
      return restrictUsers.call(this as UserPrivacySettingRuleRestrictUsers);
    case UserPrivacySettingRuleRestrictChatMembers.constructor:
      return restrictChatMembers
          .call(this as UserPrivacySettingRuleRestrictChatMembers);
  }
  throw StateError('not handled type Generator');
}