$UikThreeTextCardPropsFromJson function

UikThreeTextCardProps $UikThreeTextCardPropsFromJson(
  1. Map<String, dynamic> json
)

Implementation

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

  final List<dynamic>? textList =
      jsonConvert.convert<List<dynamic>>(json['textList']);
  if (textList != null) {
    for (int i = 0; i < textList.length; i++) {
      uikThreeTextCardProps.textList.add(UikContainerText(
          WidgetType.UikText, UikContainerTextProps.fromJson(textList[i])));
    }
  }

  final double? leftMargin = jsonConvert.convert<double>(json["leftMargin"]);
  final double? rightMargin = jsonConvert.convert<double>(json["rightMargin"]);
  final double? topMargin = jsonConvert.convert<double>(json["topMargin"]);
  final double? bottomMargin =
      jsonConvert.convert<double>(json["bottomMargin"]);

  if (leftMargin != null) {
    uikThreeTextCardProps.leftMargin = leftMargin;
  }
  if (topMargin != null) {
    uikThreeTextCardProps.topMargin = topMargin;
  }
  if (bottomMargin != null) {
    uikThreeTextCardProps.bottomMargin = bottomMargin;
  }
  if (rightMargin != null) {
    uikThreeTextCardProps.rightMargin = rightMargin;
  }

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