class BackgroundModel { HeaderBg headerBg; String bgColor; BackgroundModel({this.headerBg, this.bgColor}); BackgroundModel.fromJson(Map json) { headerBg = json['header_bg'] != null ? new HeaderBg.fromJson(json['header_bg']) : null; bgColor = json['bg_color']; } Map toJson() { final Map data = new Map(); if (this.headerBg != null) { data['header_bg'] = this.headerBg.toJson(); } data['bg_color'] = this.bgColor; return data; } } class HeaderBg { String height; String mainColor; String assistColor; String minorColor; HeaderBg({this.height, this.mainColor, this.assistColor, this.minorColor}); HeaderBg.fromJson(Map json) { height = json['height']; mainColor = json['main_color']; assistColor = json['assist_color']; minorColor = json['minor_color']; } Map toJson() { final Map data = new Map(); data['height'] = this.height; data['main_color'] = this.mainColor; data['assist_color'] = this.assistColor; data['minor_color'] = this.minorColor; return data; } }