Data.fromJson constructor

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

Implementation

Data.fromJson(Map<String, dynamic> json){
  name = json['name'] == null ? "" : json['name'] ;
  shortName = json['short_name'] == null ? "" : json['short_name'];

  if(json['questions'] == null)
    {
      questions = [];
    }
  else
    {
      questions = List.from(json['questions']).map((e)=>Questions.fromJson(e)).toList();
    }


}