fromJson method

  1. @override
UPostLabel fromJson(
  1. Map<String, dynamic> json
)

Implementation

@override
UPostLabel fromJson(Map<String, dynamic> json) {
  try {
    if (isSelfLabels(json)) {
      return UPostLabel.selfLabels(
        data: const SelfLabelsConverter().fromJson(json),
      );
    }

    return UPostLabel.unknown(data: json);
  } catch (_) {
    return UPostLabel.unknown(data: json);
  }
}