fromJson static method

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

Implementation

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

  return StoryInteractionInfo(
    viewCount: (json['view_count'] as int?) ?? 0,
    forwardCount: (json['forward_count'] as int?) ?? 0,
    reactionCount: (json['reaction_count'] as int?) ?? 0,
    recentViewerUserIds: List<int>.from(
      tdListFromJson(
        json['recent_viewer_user_ids'],
      ).map((item) => int.tryParse((item as dynamic)?.toString() ?? '') ?? 0),
    ),
  );
}