map<TResult extends Object?> method

TResult map<TResult extends Object?>({
  1. required TResult completed(
    1. GiveawayInfoCompleted value
    ),
  2. required TResult ongoing(
    1. GiveawayInfoOngoing value
    ),
})

Implementation

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