$UikThreeColumnProductPropsFromJson function

UikThreeColumnProductProps $UikThreeColumnProductPropsFromJson(
  1. Map<String, dynamic> json
)

Implementation

UikThreeColumnProductProps $UikThreeColumnProductPropsFromJson(
    Map<String, dynamic> json) {
  final UikThreeColumnProductProps uikThreeColumnProductProps =
      UikThreeColumnProductProps();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    uikThreeColumnProductProps.id = id;
  }

  if (json['firstComponent']['id'] == 'twoComponentRow1') {
    uikThreeColumnProductProps.firstComponent = UikTwoComponentRow(
      WidgetType.UikTwoComponentRow,
      UikTwoComponentRowProps.fromJson(
        json['firstComponent'],
      ),
    );
  }
  if (json['secondComponent']['id'] == 'twoComponentRow2') {
    uikThreeColumnProductProps.secondComponent = UikTwoComponentRow(
      WidgetType.UikTwoComponentRow,
      UikTwoComponentRowProps.fromJson(
        json['secondComponent'],
      ),
    );
  }
  if (json['thirdComponent']['id'] == 'scrollProduct') {
    uikThreeColumnProductProps.thirdComponent = UikScrollProducts(
      WidgetType.UikScrollProducts,
      UikScrollProductsProps.fromJson(
        json['thirdComponent'],
      ),
    );
  }

  uikThreeColumnProductProps.marginBottom =
      jsonConvert.convert<double>(json['marginBottom']) ?? 0.0;
  uikThreeColumnProductProps.marginLeft =
      jsonConvert.convert<double>(json['marginLeft']) ?? 0.0;
  uikThreeColumnProductProps.marginRight =
      jsonConvert.convert<double>(json['marginRight']) ?? 0.0;
  uikThreeColumnProductProps.marginTop =
      jsonConvert.convert<double>(json['marginTop']) ?? 0.0;
  return uikThreeColumnProductProps;
}