$UikDiscountPropsFromJson function
Implementation
UikDiscountProps $UikDiscountPropsFromJson(Map<String, dynamic> json) {
final UikDiscountProps uikDiscountProps = UikDiscountProps();
final String? id = jsonConvert.convert<String>(json['id']);
if (id != null) {
uikDiscountProps.id = id;
}
final UikAction? action = jsonConvert.convert<UikAction>(json['action']);
if (action != null) {
uikDiscountProps.action = action;
}
final String? centerText1 = jsonConvert.convert<String>(json['centerText1']);
if (centerText1 != null) {
uikDiscountProps.centerText1 =
UikText(WidgetType.UikText, UikTextProps.fromJson(json['centerText1']));
}
final String? centerText2 = jsonConvert.convert<String>(json['centerText2']);
if (centerText2 != null) {
uikDiscountProps.centerText2 =
UikText(WidgetType.UikText, UikTextProps.fromJson(json['centerText2']));
}
final String? button = jsonConvert.convert<String>(json['button']);
if (button != null) {
uikDiscountProps.button =
UikButton(WidgetType.UikText, UikButtonProps.fromJson(json['button']));
}
final String? Icon = jsonConvert.convert<String>(json['icon']);
if (Icon != null) {
uikDiscountProps.icon =
UikIcon(WidgetType.UikText, UikIconProps.fromJson(json['icon']));
}
final double? sideMargin = jsonConvert.convert<double>(json['sideMargin']);
if (sideMargin != null) {
uikDiscountProps.sideMargin = sideMargin;
}
final double? topMargin = jsonConvert.convert<double>(json['topMargin']);
if (topMargin != null) {
uikDiscountProps.topMargin = topMargin;
}
final double? bottomMargin =
jsonConvert.convert<double>(json['bottomMargin']);
if (bottomMargin != null) {
uikDiscountProps.bottomMargin = bottomMargin;
}
return uikDiscountProps;
}