map<TResult extends Object?> method

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

Implementation

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