UProductResponse.fromMap constructor

UProductResponse.fromMap(
  1. Map<String, dynamic> json
)

Implementation

factory UProductResponse.fromMap(Map<String, dynamic> json) => UProductResponse(
  id: json["id"],
  createdAt: DateTime.parse(json["createdAt"]),
  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"],
  point: json["point"],
  parentId: json["parentId"],
  creatorId: json["creatorId"],
  commentCount: json["commentCount"],
  isFollowing: json["isFollowing"],
  childrenCount: json["childrenCount"],
  creator: json["creator"] == null ? null : UUserResponse.fromMap(json["creator"]),
  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))),
  adminUserIds: json["adminUserIds"] == null ? <String>[] : List<String>.from(json["adminUserIds"]!.map((dynamic x) => x)),
  order: json["order"],
);