$UikTextChipPropsFromJson function

UikTextChipProps $UikTextChipPropsFromJson(
  1. Map<String, dynamic> json
)

Implementation

UikTextChipProps $UikTextChipPropsFromJson(Map<String, dynamic> json) {
  final UikTextChipProps uikTextChipProps = UikTextChipProps();

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

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

  final String? bgColor = jsonConvert.convert<String>(json["bgColor"]);
  if (bgColor != null) {
    uikTextChipProps.bgColor = Color(int.parse(bgColor));
  }

  final double? borderRadius =
      jsonConvert.convert<double>(json["borderRadius"]);
  if (borderRadius != null) {
    uikTextChipProps.borderRadius = borderRadius;
  }

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

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

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

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

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