fromJson static method

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

Implementation

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

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

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

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

    default:
      return null;
  }
}