KeyboardButtonType.fromJson constructor

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

Implementation

factory KeyboardButtonType.fromJson(Map<String, dynamic> json) {
  switch (json["@type"]) {
    case KeyboardButtonTypeText.CONSTRUCTOR:
      return KeyboardButtonTypeText.fromJson(json);
    case KeyboardButtonTypeRequestPhoneNumber.CONSTRUCTOR:
      return KeyboardButtonTypeRequestPhoneNumber.fromJson(json);
    case KeyboardButtonTypeRequestLocation.CONSTRUCTOR:
      return KeyboardButtonTypeRequestLocation.fromJson(json);
    case KeyboardButtonTypeRequestPoll.CONSTRUCTOR:
      return KeyboardButtonTypeRequestPoll.fromJson(json);
    case KeyboardButtonTypeRequestUser.CONSTRUCTOR:
      return KeyboardButtonTypeRequestUser.fromJson(json);
    case KeyboardButtonTypeRequestChat.CONSTRUCTOR:
      return KeyboardButtonTypeRequestChat.fromJson(json);
    case KeyboardButtonTypeWebApp.CONSTRUCTOR:
      return KeyboardButtonTypeWebApp.fromJson(json);
    default:
      return const KeyboardButtonType();
  }
}