InlineKeyboardButtonType.fromJson constructor
a InlineKeyboardButtonType return type can be :
- InlineKeyboardButtonTypeUrl
- InlineKeyboardButtonTypeLoginUrl
- InlineKeyboardButtonTypeWebApp
- InlineKeyboardButtonTypeCallback
- InlineKeyboardButtonTypeCallbackWithPassword
- InlineKeyboardButtonTypeCallbackGame
- InlineKeyboardButtonTypeSwitchInline
- InlineKeyboardButtonTypeBuy
- InlineKeyboardButtonTypeUser
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 InlineKeyboardButtonTypeWebApp.CONSTRUCTOR:
return InlineKeyboardButtonTypeWebApp.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();
}
}