map<TResult extends Object?> method

TResult map<TResult extends Object?>({
  1. required TResult appleId(
    1. EmailAddressAuthenticationAppleId value
    ),
  2. required TResult code(
    1. EmailAddressAuthenticationCode value
    ),
  3. required TResult googleId(
    1. EmailAddressAuthenticationGoogleId value
    ),
})

Implementation

TResult map<TResult extends Object?>({
  required TResult Function(EmailAddressAuthenticationAppleId value) appleId,
  required TResult Function(EmailAddressAuthenticationCode value) code,
  required TResult Function(EmailAddressAuthenticationGoogleId value)
  googleId,
}) {
  switch (getConstructor()) {
    case EmailAddressAuthenticationAppleId.constructor:
      return appleId.call(this as EmailAddressAuthenticationAppleId);
    case EmailAddressAuthenticationCode.constructor:
      return code.call(this as EmailAddressAuthenticationCode);
    case EmailAddressAuthenticationGoogleId.constructor:
      return googleId.call(this as EmailAddressAuthenticationGoogleId);
  }
  throw StateError('not handled type Generator');
}