import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; part 'widget_model.g.dart'; @JsonSerializable() // ignore: must_be_immutable class WidgetModel extends Object implements Equatable { @JsonKey(name: 'aspect_ratio') String aspectRatio; @JsonKey(name: 'badge') String badge; @JsonKey(name: 'bg_color') String bgColor; @JsonKey(name: 'bg_color_t') String bgColorT; @JsonKey(name: 'bg_img') String bgImg; @JsonKey(name: 'components') List components; @JsonKey(name: 'data') String data; @JsonKey(name: 'font_color') String fontColor; @JsonKey(name: 'icon') String icon; @JsonKey(name: 'img') String img; @JsonKey(name: 'is_global') int isGlobal; @JsonKey(name: 'margin') String margin; @JsonKey(name: 'mod_id') int modId; @JsonKey(name: 'mod_name') String modName; @JsonKey(name: 'mod_pid') int modPid; @JsonKey(name: 'path') String path; @JsonKey(name: 'position') String position; @JsonKey(name: 'sort') int sort; @JsonKey(name: 'subtitle') String subtitle; @JsonKey(name: 'title') String title; @JsonKey(name: 'url') String url; WidgetModel( this.aspectRatio, this.badge, this.bgColor, this.bgColorT, this.bgImg, this.components, this.data, this.fontColor, this.icon, this.img, this.isGlobal, this.margin, this.modId, this.modName, this.modPid, this.path, this.position, this.sort, this.subtitle, this.title, this.url, ); factory WidgetModel.fromJson(Map srcJson) => _$WidgetModelFromJson(srcJson); Map toJson() => _$WidgetModelToJson(this); @override List get props => [modId]; @override bool get stringify => null; }