ArticleModel.fromJson constructor

ArticleModel.fromJson(
  1. Map map
)

Implementation

factory ArticleModel.fromJson(Map map) {
  String deflectionArticleId = map['deflectionArticleId'];
  int brandId = map['brandId'];
  String articleId = map['articleId'];
  String body = map['body'] ?? '';
  String htmlURL = map['htmlURL'];
  Iterable<String> labels = ((map['labels'] ?? []) as Iterable).map((e) => e);
  String locale = map['locale'];
  double score = map['score'];
  String snippet = map['snippet'];
  String title = map['title'];
  String url = map['url'];

  return ArticleModel(
    deflectionArticleId,
    brandId,
    articleId,
    body,
    htmlURL,
    labels,
    locale,
    score,
    snippet,
    title,
    url,
  );
}