fromJson static method

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

Implementation

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

  return StoryInteractions(
    totalCount: (json['total_count'] as int?) ?? 0,
    totalForwardCount: (json['total_forward_count'] as int?) ?? 0,
    totalReactionCount: (json['total_reaction_count'] as int?) ?? 0,
    interactions: List<StoryInteraction>.from(
      tdListFromJson(json['interactions'])
          .map((item) => StoryInteraction.fromJson(tdMapFromJson(item)))
          .whereType<StoryInteraction>(),
    ),
    nextOffset: (json['next_offset'] as String?) ?? '',
  );
}