import 'package:PiliPlus/models_new/space/space_shop/below_label.dart'; import 'package:PiliPlus/models_new/space/space_shop/benefit_info.dart'; import 'package:PiliPlus/models_new/space/space_shop/cover.dart'; import 'package:PiliPlus/models_new/space/space_shop/net_price.dart'; class SpaceShopItem { Cover? cover; String? title; String? cardUrl; List? belowLabels; NetPrice? netPrice; List? benefitInfos; String? itemSourceName; SpaceShopItem({ this.cover, this.title, this.cardUrl, this.belowLabels, this.netPrice, this.benefitInfos, this.itemSourceName, }); factory SpaceShopItem.fromJson(Map json) => SpaceShopItem( cover: json['cover'] == null ? null : Cover.fromJson(json['cover'] as Map), title: json['title'] as String?, cardUrl: json['cardUrl'] as String?, belowLabels: (json['belowLabels'] as List?) ?.map((e) => BelowLabel.fromJson(e as Map)) .toList(), netPrice: json['netPrice'] == null ? null : NetPrice.fromJson(json['netPrice'] as Map), benefitInfos: (json['benefitInfos'] as List?) ?.map((e) => BenefitInfo.fromJson(e as Map)) .toList(), itemSourceName: json['itemSourceName'] as String?, ); }