map<TResult extends Object?> method

TResult map<TResult extends Object?>({
  1. required TResult channel(
    1. ChatStatisticsChannel value
    ),
  2. required TResult supergroup(
    1. ChatStatisticsSupergroup value
    ),
})

Implementation

TResult map<TResult extends Object?>({
  required TResult Function(ChatStatisticsChannel value) channel,
  required TResult Function(ChatStatisticsSupergroup value) supergroup,
}) {
  switch (getConstructor()) {
    case ChatStatisticsChannel.constructor:
      return channel.call(this as ChatStatisticsChannel);
    case ChatStatisticsSupergroup.constructor:
      return supergroup.call(this as ChatStatisticsSupergroup);
  }
  throw StateError('not handled type Generator');
}