SecretChatState.fromJson constructor

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

a SecretChatState return type can be :

Implementation

factory SecretChatState.fromJson(Map<String, dynamic> json) {
  switch (json["@type"]) {
    case SecretChatStatePending.CONSTRUCTOR:
      return SecretChatStatePending.fromJson(json);
    case SecretChatStateReady.CONSTRUCTOR:
      return SecretChatStateReady.fromJson(json);
    case SecretChatStateClosed.CONSTRUCTOR:
      return SecretChatStateClosed.fromJson(json);
    default:
      return const SecretChatState();
  }
}