map<TResult extends Object?> method

TResult map<TResult extends Object?>({
  1. required TResult channelChats(
    1. AutosaveSettingsScopeChannelChats value
    ),
  2. required TResult chat(
    1. AutosaveSettingsScopeChat value
    ),
  3. required TResult groupChats(
    1. AutosaveSettingsScopeGroupChats value
    ),
  4. required TResult privateChats(
    1. AutosaveSettingsScopePrivateChats value
    ),
})

Implementation

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