fromJson method

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

Implementation

NewsModel fromJson(Map<String, dynamic> json) {
  id = Util.getValueFromJson(json, 'id', -1);
  article_catalogue_id = Util.getValueFromJson(json, 'article_catalogue_id', -1);
  title = Util.getValueFromJson(json, 'title', '');
  content = Util.getValueFromJson(json, 'content', '');
  image = Util.getValueFromJson(json, 'image', '');
  created_at = Util.getValueFromJson(json, 'created_at', '');
  return this;
}