$UikProductImageTitlePriceCardPropsFromJson function

UikProductImageTitlePriceCardProps $UikProductImageTitlePriceCardPropsFromJson(
  1. Map<String, dynamic> json
)

Implementation

UikProductImageTitlePriceCardProps $UikProductImageTitlePriceCardPropsFromJson(
    Map<String, dynamic> json) {
  final UikProductImageTitlePriceCardProps uikProductImageTitlePriceCardProps =
      UikProductImageTitlePriceCardProps();

  final String? id = jsonConvert.convert<String>(json['id']);

  final String? imageUrl = jsonConvert.convert<String>(json["imageUrl"]);

  final String? title = jsonConvert.convert<String>(json["title"]);

  final String? price = jsonConvert.convert<String>(json["price"]);

  final String? discountedPrice =
      jsonConvert.convert<String>(json["discountedPrice"]);

  if (id != null) {
    uikProductImageTitlePriceCardProps.id = id;
  }

  if (imageUrl != null) {
    uikProductImageTitlePriceCardProps.imageUrl = imageUrl;
  }

  if (title != null) {
    uikProductImageTitlePriceCardProps.title =
        UikText(WidgetType.UikText, UikTextProps.fromJson(json["title"]));
  }

  if (price != null) {
    uikProductImageTitlePriceCardProps.price =
        UikText(WidgetType.UikText, UikTextProps.fromJson(json["price"]));
  }

  if (discountedPrice != null) {
    uikProductImageTitlePriceCardProps.discountedPrice = UikText(
        WidgetType.UikText, UikTextProps.fromJson(json["discountedPrice"]));
  }

  final UikAction? action = jsonConvert.convert<UikAction>(json['action']);
  if (action != null) {
    uikProductImageTitlePriceCardProps.action = action;
  }

  return uikProductImageTitlePriceCardProps;
}