fromJson method

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

Implementation

@override
UFeedViewPostReason fromJson(Map<String, dynamic> json) {
  try {
    if (isReasonRepost(json)) {
      return UFeedViewPostReason.reasonRepost(
        data: const ReasonRepostConverter().fromJson(json),
      );
    }

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