map<TResult extends Object?> method

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

Implementation

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