Ver código fonte

更新数据模型

tags/0.0.1
Weller 4 anos atrás
pai
commit
8abb2c6cbe
2 arquivos alterados com 12 adições e 11 exclusões
  1. +1
    -0
      lib/pages/security_page/models/security_style_model.dart
  2. +11
    -11
      lib/widgets/home/home_banner/model/HomeBannerModel.dart

+ 1
- 0
lib/pages/security_page/models/security_style_model.dart Ver arquivo

@@ -62,6 +62,7 @@ class SecurityStyleItemModel extends SkipModel {
{this.dataKeys, this.name, this.nameColor, this.descColor});

SecurityStyleItemModel.fromJson(Map<String, dynamic> json) {
super.fromJson(json);
dataKeys = json['data_keys'].cast<String>();
name = json['name'];
nameColor = json['name_color'];


+ 11
- 11
lib/widgets/home/home_banner/model/HomeBannerModel.dart Ver arquivo

@@ -7,7 +7,11 @@ class HomeBannerModel {

factory HomeBannerModel.fromJson(Map<String, dynamic> json) {
return HomeBannerModel(
list: json['list'] != null ? (json['list'] as List).map((i) => HomeBannerListItemModel.fromJson(i)).toList() : null,
list: json['list'] != null
? (json['list'] as List)
.map((i) => HomeBannerListItemModel.fromJson(i))
.toList()
: null,
);
}

@@ -20,23 +24,19 @@ class HomeBannerModel {
}
}

class HomeBannerListItemModel extends SkipModel{
class HomeBannerListItemModel extends SkipModel {
String img;
String skip_identifier;

HomeBannerListItemModel({this.img, this.skip_identifier});
HomeBannerListItemModel({this.img});

factory HomeBannerListItemModel.fromJson(Map<String, dynamic> json) {
return HomeBannerListItemModel(
img: json['img']?.toString(),
skip_identifier: json['skip_identifier']?.toString(),
);
HomeBannerListItemModel.fromJson(Map<String, dynamic> json) {
super.fromJson(json);
img = json['img']?.toString();
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
final Map<String, dynamic> data = super.toJson();
data['img'] = this.img;
data['skip_identifier'] = this.skip_identifier;
return data;
}
}

Carregando…
Cancelar
Salvar