Data.fromJson constructor

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

Implementation

Data.fromJson(Map<String, dynamic> json) {
  if (json['news_list'] != null) {
    newsList = <News>[];
    json['news_list'].forEach((v) {
      newsList!.add(News.fromJson(v));
    });
  }
}