map<TResult extends Object?> method

TResult map<TResult extends Object?>({
  1. required TResult channelChats(
    1. NotificationSettingsScopeChannelChats value
    ),
  2. required TResult groupChats(
    1. NotificationSettingsScopeGroupChats value
    ),
  3. required TResult privateChats(
    1. NotificationSettingsScopePrivateChats value
    ),
})

Implementation

TResult map<TResult extends Object?>({
  required TResult Function(NotificationSettingsScopeChannelChats value)
  channelChats,
  required TResult Function(NotificationSettingsScopeGroupChats value)
  groupChats,
  required TResult Function(NotificationSettingsScopePrivateChats value)
  privateChats,
}) {
  switch (getConstructor()) {
    case NotificationSettingsScopeChannelChats.constructor:
      return channelChats.call(this as NotificationSettingsScopeChannelChats);
    case NotificationSettingsScopeGroupChats.constructor:
      return groupChats.call(this as NotificationSettingsScopeGroupChats);
    case NotificationSettingsScopePrivateChats.constructor:
      return privateChats.call(this as NotificationSettingsScopePrivateChats);
  }
  throw StateError('not handled type Generator');
}