fromJson static method

ProductInfo? fromJson(
  1. Map<String, dynamic>? json
)

Implementation

static ProductInfo? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return ProductInfo(
    title: (json['title'] as String?) ?? '',
    description: FormattedText.fromJson(tdMapFromJson(json['description'])),
    photo: Photo.fromJson(tdMapFromJson(json['photo'])),
  );
}