map<TResult extends Object?> method

TResult map<TResult extends Object?>({
  1. required TResult url(
    1. InlineKeyboardButtonTypeUrl value
    ),
  2. required TResult loginUrl(
    1. InlineKeyboardButtonTypeLoginUrl value
    ),
  3. required TResult webApp(
    1. InlineKeyboardButtonTypeWebApp value
    ),
  4. required TResult callback(
    1. InlineKeyboardButtonTypeCallback value
    ),
  5. required TResult callbackWithPassword(
    1. InlineKeyboardButtonTypeCallbackWithPassword value
    ),
  6. required TResult callbackGame(
    1. InlineKeyboardButtonTypeCallbackGame value
    ),
  7. required TResult switchInline(
    1. InlineKeyboardButtonTypeSwitchInline value
    ),
  8. required TResult buy(
    1. InlineKeyboardButtonTypeBuy value
    ),
  9. required TResult user(
    1. InlineKeyboardButtonTypeUser value
    ),
  10. required TResult copyText(
    1. InlineKeyboardButtonTypeCopyText value
    ),
  11. required TResult disabled(
    1. InlineKeyboardButtonTypeDisabled value
    ),
})

Implementation

TResult map<TResult extends Object?>({
  required TResult Function(InlineKeyboardButtonTypeUrl value) url,
  required TResult Function(InlineKeyboardButtonTypeLoginUrl value) loginUrl,
  required TResult Function(InlineKeyboardButtonTypeWebApp value) webApp,
  required TResult Function(InlineKeyboardButtonTypeCallback value) callback,
  required TResult Function(
          InlineKeyboardButtonTypeCallbackWithPassword value)
      callbackWithPassword,
  required TResult Function(InlineKeyboardButtonTypeCallbackGame value)
      callbackGame,
  required TResult Function(InlineKeyboardButtonTypeSwitchInline value)
      switchInline,
  required TResult Function(InlineKeyboardButtonTypeBuy value) buy,
  required TResult Function(InlineKeyboardButtonTypeUser value) user,
  required TResult Function(InlineKeyboardButtonTypeCopyText value) copyText,
  required TResult Function(InlineKeyboardButtonTypeDisabled value) disabled,
}) {
  switch (getConstructor()) {
    case InlineKeyboardButtonTypeUrl.constructor:
      return url.call(this as InlineKeyboardButtonTypeUrl);
    case InlineKeyboardButtonTypeLoginUrl.constructor:
      return loginUrl.call(this as InlineKeyboardButtonTypeLoginUrl);
    case InlineKeyboardButtonTypeWebApp.constructor:
      return webApp.call(this as InlineKeyboardButtonTypeWebApp);
    case InlineKeyboardButtonTypeCallback.constructor:
      return callback.call(this as InlineKeyboardButtonTypeCallback);
    case InlineKeyboardButtonTypeCallbackWithPassword.constructor:
      return callbackWithPassword
          .call(this as InlineKeyboardButtonTypeCallbackWithPassword);
    case InlineKeyboardButtonTypeCallbackGame.constructor:
      return callbackGame.call(this as InlineKeyboardButtonTypeCallbackGame);
    case InlineKeyboardButtonTypeSwitchInline.constructor:
      return switchInline.call(this as InlineKeyboardButtonTypeSwitchInline);
    case InlineKeyboardButtonTypeBuy.constructor:
      return buy.call(this as InlineKeyboardButtonTypeBuy);
    case InlineKeyboardButtonTypeUser.constructor:
      return user.call(this as InlineKeyboardButtonTypeUser);
    case InlineKeyboardButtonTypeCopyText.constructor:
      return copyText.call(this as InlineKeyboardButtonTypeCopyText);
    case InlineKeyboardButtonTypeDisabled.constructor:
      return disabled.call(this as InlineKeyboardButtonTypeDisabled);
  }
  throw StateError('not handled type Generator');
}