import 'package:zhiying_base_widget/widgets/home/home_goods/models/home_goods_model.dart';

// ignore: must_be_immutable

class FavoritesGoodsListDataModel {
  // 是否全选
  bool isAllSelect = false;

  List<FavoritesGoodsListItemModel> lists = [];

  // FavoritesGoodsListDataModel({this.isEditing, this.isAllSelect, this.lists });
  FavoritesGoodsListDataModel();

  FavoritesGoodsListDataModel.fromJson(Map<String, dynamic> json) {
    isAllSelect = json['isAllSelect'] ?? false;
    if(json['data'] != null){
      json['data'].forEach((v){
        lists.add(new FavoritesGoodsListItemModel.fromJson(v));
      });
    }
  }
}

class FavoritesGoodsListItemModel extends HomeGoodsModel {
  bool isSelect;

  FavoritesGoodsListItemModel.fromJson(Map<String, dynamic> json) {
    super.fromJson(json);
    isSelect = json['isSelect'] ?? false;
  }

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