$UikThreeComponentRowPropsFromJson function

UikThreeComponentRowProps $UikThreeComponentRowPropsFromJson(
  1. Map<String, dynamic> json
)

Implementation

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

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

  final String? middletext = jsonConvert.convert<String>(json['middletext']);
  if (middletext != null) {
    uikThreeComponentRowProps.middletext =
        UikText(WidgetType.UikText, UikTextProps.fromJson(json['middletext']));
  }

  final String? icon = jsonConvert.convert<String>(json['icon']);
  if (middletext != null) {
    uikThreeComponentRowProps.icon =
        UikIcon(WidgetType.UikText, UikIconProps.fromJson(json['icon']));
  }

  final String? endtext = jsonConvert.convert<String>(json['endtext']);
  if (endtext != null) {
    if (json["endtext"]["id"] == "button") {
      uikThreeComponentRowProps.endtext = UikButton(
          WidgetType.UikText, UikButtonProps.fromJson(json['endtext']));
    } else {
      uikThreeComponentRowProps.endtext =
          UikText(WidgetType.UikText, UikTextProps.fromJson(json['endtext']));
    }
  }

  final double? leftMargin = jsonConvert.convert<double>(json['marginLeft']);
  if (leftMargin != null) {
    uikThreeComponentRowProps.marginLeft = leftMargin;
  }

  final double? rightMargin = jsonConvert.convert<double>(json['marginRight']);
  if (rightMargin != null) {
    uikThreeComponentRowProps.marginRight = rightMargin;
  }

  final double? topMargin = jsonConvert.convert<double>(json['marginTop']);
  if (topMargin != null) {
    uikThreeComponentRowProps.marginTop = topMargin;
  }

  final double? bottomMargin =
      jsonConvert.convert<double>(json['marginBottom']);
  if (bottomMargin != null) {
    uikThreeComponentRowProps.marginBottom = bottomMargin;
  }

  return uikThreeComponentRowProps;
}