InlineKeyboardButtonType.fromJson constructor

InlineKeyboardButtonType.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory InlineKeyboardButtonType.fromJson(Map<String, dynamic> json)  {
  switch(json["@type"]) {
    case InlineKeyboardButtonTypeUrl.CONSTRUCTOR:
      return InlineKeyboardButtonTypeUrl.fromJson(json);
    case InlineKeyboardButtonTypeLoginUrl.CONSTRUCTOR:
      return InlineKeyboardButtonTypeLoginUrl.fromJson(json);
    case InlineKeyboardButtonTypeCallback.CONSTRUCTOR:
      return InlineKeyboardButtonTypeCallback.fromJson(json);
    case InlineKeyboardButtonTypeCallbackWithPassword.CONSTRUCTOR:
      return InlineKeyboardButtonTypeCallbackWithPassword.fromJson(json);
    case InlineKeyboardButtonTypeCallbackGame.CONSTRUCTOR:
      return InlineKeyboardButtonTypeCallbackGame.fromJson(json);
    case InlineKeyboardButtonTypeSwitchInline.CONSTRUCTOR:
      return InlineKeyboardButtonTypeSwitchInline.fromJson(json);
    case InlineKeyboardButtonTypeBuy.CONSTRUCTOR:
      return InlineKeyboardButtonTypeBuy.fromJson(json);
    case InlineKeyboardButtonTypeUser.CONSTRUCTOR:
      return InlineKeyboardButtonTypeUser.fromJson(json);
    default:
      return const InlineKeyboardButtonType();
  }
}