parent
793b71ecd3
commit
d4020f961c
@ -0,0 +1,48 @@
|
|||||||
|
import 'package:aku_community/model/common/img_model.dart';
|
||||||
|
import 'package:equatable/equatable.dart';
|
||||||
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
|
part 'goods_detail_model.g.dart';
|
||||||
|
|
||||||
|
@JsonSerializable()
|
||||||
|
class GoodsDetailModel extends Equatable {
|
||||||
|
final int id;
|
||||||
|
final String recommend;
|
||||||
|
final String title;
|
||||||
|
final double sellingPrice;
|
||||||
|
final double markingPrice;
|
||||||
|
final String categoryName;
|
||||||
|
final int subscribeNum;
|
||||||
|
final String detail;
|
||||||
|
final String arrivalTime;
|
||||||
|
final List<ImgModel> goodsImgList;
|
||||||
|
final int supplierId;
|
||||||
|
final String supplierName;
|
||||||
|
final String supplierTel;
|
||||||
|
final String? supplierAddress;
|
||||||
|
final List<ImgModel> supplierImgList;
|
||||||
|
final int isSubscribe;
|
||||||
|
|
||||||
|
GoodsDetailModel(
|
||||||
|
this.id,
|
||||||
|
this.recommend,
|
||||||
|
this.title,
|
||||||
|
this.sellingPrice,
|
||||||
|
this.markingPrice,
|
||||||
|
this.categoryName,
|
||||||
|
this.subscribeNum,
|
||||||
|
this.detail,
|
||||||
|
this.arrivalTime,
|
||||||
|
this.goodsImgList,
|
||||||
|
this.supplierId,
|
||||||
|
this.supplierName,
|
||||||
|
this.supplierTel,
|
||||||
|
this.supplierAddress,
|
||||||
|
this.supplierImgList,
|
||||||
|
this.isSubscribe);
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object?> get props => throw UnimplementedError();
|
||||||
|
|
||||||
|
factory GoodsDetailModel.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$GoodsDetailModelFromJson(json);
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'goods_detail_model.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// JsonSerializableGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
GoodsDetailModel _$GoodsDetailModelFromJson(Map<String, dynamic> json) {
|
||||||
|
return GoodsDetailModel(
|
||||||
|
json['id'] as int,
|
||||||
|
json['recommend'] as String,
|
||||||
|
json['title'] as String,
|
||||||
|
(json['sellingPrice'] as num).toDouble(),
|
||||||
|
(json['markingPrice'] as num).toDouble(),
|
||||||
|
json['categoryName'] as String,
|
||||||
|
json['subscribeNum'] as int,
|
||||||
|
json['detail'] as String,
|
||||||
|
json['arrivalTime'] as String,
|
||||||
|
(json['goodsImgList'] as List<dynamic>)
|
||||||
|
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
|
||||||
|
.toList(),
|
||||||
|
json['supplierId'] as int,
|
||||||
|
json['supplierName'] as String,
|
||||||
|
json['supplierTel'] as String,
|
||||||
|
json['supplierAddress'] as String?,
|
||||||
|
(json['supplierImgList'] as List<dynamic>)
|
||||||
|
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
|
||||||
|
.toList(),
|
||||||
|
json['isSubscribe'] as int,
|
||||||
|
);
|
||||||
|
}
|
Loading…
Reference in new issue