$UikBagItemPropsFromJson function

UikBagItemProps $UikBagItemPropsFromJson(
  1. Map<String, dynamic> json
)

Implementation

UikBagItemProps $UikBagItemPropsFromJson(Map<String, dynamic> json) {
  print(json);
  final UikBagItemProps uikBagItemProps = UikBagItemProps();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    uikBagItemProps.id = id;
  }
  final String? productPrice =
      jsonConvert.convert<String>(json['productPrice']);
  if (productPrice != null) {
    uikBagItemProps.productPrice = productPrice;
  }

  final String? productDescription =
      jsonConvert.convert<String>(json['productDescription']);
  if (productDescription != null) {
    uikBagItemProps.productDescription = productDescription;
  }

  final String? imageUrl = jsonConvert.convert<String>(json['imageUrl']);
  if (imageUrl != null) {
    uikBagItemProps.imageUrl = imageUrl;
  }

  final String? stepper = jsonConvert.convert<String>(json['stepper']);
  // print(json['stepper']);
  // print(stepper);
  if (stepper != null) {
    uikBagItemProps.stepper = UikStepper(
        WidgetType.UikText, UikStepperProps.fromJson(json['stepper']));
  }

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

  if (deleteIcon != null) {
    uikBagItemProps.deleteIcon =
        UikButton(WidgetType.UikText, UikButtonProps.fromJson(json['deleteIcon']));
  }

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