$UikRowTextPropsFromJson function

UikRowTextProps $UikRowTextPropsFromJson(
  1. Map<String, dynamic> json
)

Implementation

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

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

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

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

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

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

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

  final String? color = jsonConvert.convert<String>(json['color']);
  if (color != null) {
    uikRowTextProps.color = Color(int.parse(color));
  }

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

  final String? fontWeight = jsonConvert.convert<String>(json['fontWeight']);
  if (fontWeight != null) {
    if (fontWeight == "FontWeight.bold") {
      uikRowTextProps.fontWeight = FontWeight.bold;
    }
    if (fontWeight == "FontWeight.w100") {
      uikRowTextProps.fontWeight = FontWeight.w100;
    }
    if (fontWeight == "FontWeight.w200") {
      uikRowTextProps.fontWeight = FontWeight.w200;
    }
    if (fontWeight == "FontWeight.w300") {
      uikRowTextProps.fontWeight = FontWeight.w300;
    }
    if (fontWeight == "FontWeight.w400") {
      uikRowTextProps.fontWeight = FontWeight.w400;
    }
    if (fontWeight == "FontWeight.w500") {
      uikRowTextProps.fontWeight = FontWeight.w500;
    }
    if (fontWeight == "FontWeight.w600") {
      uikRowTextProps.fontWeight = FontWeight.w600;
    }
    if (fontWeight == "FontWeight.w700") {
      uikRowTextProps.fontWeight = FontWeight.w700;
    }
    if (fontWeight == "FontWeight.w800") {
      uikRowTextProps.fontWeight = FontWeight.w800;
    }
    if (fontWeight == "FontWeight.w900") {
      uikRowTextProps.fontWeight = FontWeight.w900;
    }
  }
  final String? fontFamily = jsonConvert.convert<String>(json['fontFamily']);
  if (fontFamily != null) {
    uikRowTextProps.fontFamily = fontFamily;
  }
  final double? width = jsonConvert.convert<double>(json['width']);
  if (width != null) {
    uikRowTextProps.width = width;
  }

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

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