map<TResult extends Object?> method

TResult map<TResult extends Object?>({
  1. required TResult bot(
    1. AffiliateTypeBot value
    ),
  2. required TResult channel(
    1. AffiliateTypeChannel value
    ),
  3. required TResult currentUser(
    1. AffiliateTypeCurrentUser value
    ),
})

Implementation

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