From 8abb2c6cbe8cff8f85384f844c8e462529bbdf26 Mon Sep 17 00:00:00 2001 From: Weller <1812208341@qq.com> Date: Thu, 24 Sep 2020 10:48:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=95=B0=E6=8D=AE=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../models/security_style_model.dart | 1 + .../home_banner/model/HomeBannerModel.dart | 22 +++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/pages/security_page/models/security_style_model.dart b/lib/pages/security_page/models/security_style_model.dart index 1a84962..a56b4dc 100644 --- a/lib/pages/security_page/models/security_style_model.dart +++ b/lib/pages/security_page/models/security_style_model.dart @@ -62,6 +62,7 @@ class SecurityStyleItemModel extends SkipModel { {this.dataKeys, this.name, this.nameColor, this.descColor}); SecurityStyleItemModel.fromJson(Map json) { + super.fromJson(json); dataKeys = json['data_keys'].cast(); name = json['name']; nameColor = json['name_color']; diff --git a/lib/widgets/home/home_banner/model/HomeBannerModel.dart b/lib/widgets/home/home_banner/model/HomeBannerModel.dart index 720493f..84b5ff9 100644 --- a/lib/widgets/home/home_banner/model/HomeBannerModel.dart +++ b/lib/widgets/home/home_banner/model/HomeBannerModel.dart @@ -7,7 +7,11 @@ class HomeBannerModel { factory HomeBannerModel.fromJson(Map 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 json) { - return HomeBannerListItemModel( - img: json['img']?.toString(), - skip_identifier: json['skip_identifier']?.toString(), - ); + HomeBannerListItemModel.fromJson(Map json) { + super.fromJson(json); + img = json['img']?.toString(); } Map toJson() { - final Map data = new Map(); + final Map data = super.toJson(); data['img'] = this.img; - data['skip_identifier'] = this.skip_identifier; return data; } }