fromJson static method

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

Implementation

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

  return FoundStories(
    totalCount: (json['total_count'] as int?) ?? 0,
    stories: List<Story>.from(
        ((json['stories'] as List<dynamic>?) ?? <dynamic>[])
            .map((item) => Story.fromJson(item as Map<String, dynamic>?))
            .toList()),
    nextOffset: (json['next_offset'] as String?) ?? '',
  );
}