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);
    default:
      return const KeyboardButtonType();
  }
}