$UikMembershipPropsFromJson function
Implementation
UikMembershipProps $UikMembershipPropsFromJson(Map<String, dynamic> json) {
final UikMembershipProps uikMembershipProps = UikMembershipProps();
final String? id = jsonConvert.convert<String>(json['id']);
if (id != null) {
uikMembershipProps.id = id;
}
final String? button = jsonConvert.convert<String>(json['button']);
if (button != null) {
uikMembershipProps.button =
UikButton(WidgetType.UikText, UikButtonProps.fromJson(json['button']));
}
final String? button2 = jsonConvert.convert<String>(json['button2']);
if (button2 != null) {
uikMembershipProps.button2 =
UikButton(WidgetType.UikText, UikButtonProps.fromJson(json['button2']));
}
final String? icon = jsonConvert.convert<String>(json['icon']);
if (icon != null) {
uikMembershipProps.icon =
UikIcon(WidgetType.UikText, UikIconProps.fromJson(json['icon']));
}
final List<dynamic>? perks =
jsonConvert.convert<List<dynamic>>(json['perks']);
if (perks != null) {
for (int i = 0; i < 3; i++) {
uikMembershipProps.perks =
perks; //.add(UikText(WidgetType.UikText, UikTextProps.fromJson(perks[i])));
}
}
// final double? widthSize = jsonConvert.convert<double>(json['widthSize']);
// print(widthSize);
// if (widthSize != null) {
// uikCellProps.widthSize = widthSize;
// }
// final double? heightSize = jsonConvert.convert<double>(json['heightSize']);
// if (heightSize != null) {
// uikCellProps.heightSize = heightSize;
// }
final double? price = jsonConvert.convert<double>(json['price']);
if (price != null) {
uikMembershipProps.price = price;
}
final String? headingText = jsonConvert.convert<String>(json['headingText']);
if (headingText != null) {
uikMembershipProps.headingText = headingText;
}
final String? subtitleText =
jsonConvert.convert<String>(json['subtitleText']);
if (subtitleText != null) {
uikMembershipProps.subtitleText = subtitleText;
}
final String? duration = jsonConvert.convert<String>(json['duration']);
if (duration != null) {
uikMembershipProps.duration = duration;
}
// final String? leftElement = jsonConvert.convert<String>(json['leftElement']);
// if (leftElement != null) {
// uikCellProps.leftElement =
// UikIcon(WidgetType.UikText, UikIconProps.fromJson(json['leftElement']));
// }
// final String? rightElement =
// jsonConvert.convert<String>(json['rightElement']);
// if (rightElement != null) {
// uikCellProps.rightElement = UikIcon(
// WidgetType.UikText, UikIconProps.fromJson(json['rightElement']));
// }
final UikAction? action = jsonConvert.convert<UikAction>(json['action']);
if (action != null) {
uikMembershipProps.action = action;
}
return uikMembershipProps;
}