fromJson static method

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

Implementation

static SecretChatState? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  switch (json['@type']) {
    case SecretChatStateClosed.constructor:
      return SecretChatStateClosed.fromJson(json);

    case SecretChatStatePending.constructor:
      return SecretChatStatePending.fromJson(json);

    case SecretChatStateReady.constructor:
      return SecretChatStateReady.fromJson(json);

    default:
      return null;
  }
}