Przeglądaj źródła

更新数据模型

tags/0.0.1
Weller 4 lat temu
rodzic
commit
8abb2c6cbe
2 zmienionych plików z 12 dodań i 11 usunięć
  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 Wyświetl plik

@@ -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 Wyświetl plik

@@ -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;
}
}

Ładowanie…
Anuluj
Zapisz