UProductResponse.fromMap constructor
UProductResponse.fromMap(
- Map<String, dynamic> json
)
Implementation
factory UProductResponse.fromMap(Map<String, dynamic> json) => UProductResponse(
id: json["id"],
createdAt: DateTime.parse(json["createdAt"]),
updatedAt: DateTime.parse(json["updatedAt"]),
jsonData: UProductJson.fromMap(json["jsonData"]),
tags: List<int>.from(json["tags"].map((dynamic x) => x)),
title: json["title"],
code: json["code"],
subtitle: json["subtitle"],
description: json["description"],
slug: json["slug"],
type: json["type"],
content: json["content"],
latitude: json["latitude"],
longitude: json["longitude"],
stock: json["stock"],
price: json["price"],
point: json["point"],
parentId: json["parentId"],
parent: json["parent"] == null ? null : UProductResponse.fromMap(json["parent"]),
userId: json["userId"],
commentCount: json["commentCount"],
isFollowing: json["isFollowing"],
visitCount: json["visitCount"],
childrenCount: json["childrenCount"],
user: json["user"] == null ? null : UUserResponse.fromMap(json["user"]),
children: json["children"] == null ? <UProductResponse>[] : List<UProductResponse>.from(json["children"].map((dynamic x) => UProductResponse.fromMap(x))),
media: json["media"] == null ? <UMediaResponse>[] : List<UMediaResponse>.from(json["media"].map((dynamic x) => UMediaResponse.fromMap(x))),
categories: json["categories"] == null ? <UCategoryResponse>[] : List<UCategoryResponse>.from(json["categories"].map((dynamic x) => UCategoryResponse.fromMap(x))),
);