map<TResult extends Object?> method

TResult map<TResult extends Object?>({
  1. required TResult closed(
    1. SecretChatStateClosed value
    ),
  2. required TResult pending(
    1. SecretChatStatePending value
    ),
  3. required TResult ready(
    1. SecretChatStateReady value
    ),
})

Implementation

TResult map<TResult extends Object?>({
  required TResult Function(SecretChatStateClosed value) closed,
  required TResult Function(SecretChatStatePending value) pending,
  required TResult Function(SecretChatStateReady value) ready,
}) {
  switch (getConstructor()) {
    case SecretChatStateClosed.constructor:
      return closed.call(this as SecretChatStateClosed);
    case SecretChatStatePending.constructor:
      return pending.call(this as SecretChatStatePending);
    case SecretChatStateReady.constructor:
      return ready.call(this as SecretChatStateReady);
  }
  throw StateError('not handled type Generator');
}