$UikContainerTextPropsFromJson function

UikContainerTextProps $UikContainerTextPropsFromJson(
  1. Map<String, dynamic> json
)

Implementation

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

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

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

  final int? maxLines = jsonConvert.convert<int>(json['maxLines']);
  if (maxLines != null) {
    uikContainerTextProps.maxLines = maxLines;
  }

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

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

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

  final String? color = jsonConvert.convert<String>(json['color']);
  if (color != null) {
    uikContainerTextProps.color = color.toColor();
  }
  final String? striketext = jsonConvert.convert<String>(json['striketext']);
  if (striketext != null) {
    uikContainerTextProps.striketext = striketext;
  }
  final bool? strikethrough = jsonConvert.convert<bool>(json['isStrike']);
  if (strikethrough != null) {
    uikContainerTextProps.isStrike = strikethrough;
  }
  final double? size = jsonConvert.convert<double>(json['size']);
  if (size != null) {
    uikContainerTextProps.size = size;
  }

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

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

  final String? align = jsonConvert.convert<String>(json['textalign']);
  if (align != null) {
    if (align == "TextAlign.center") {
      uikContainerTextProps.textalign = TextAlign.center;
    }
    if (align == "TextAlign.end") {
      uikContainerTextProps.textalign = TextAlign.end;
    }
    if (align == "TextAlign.start") {
      uikContainerTextProps.textalign = TextAlign.start;
    }
    if (align == "TextAlign.left") {
      uikContainerTextProps.textalign = TextAlign.left;
    }
    if (align == "TextAlign.right") {
      uikContainerTextProps.textalign = TextAlign.right;
    }
    if (align == "TextAlign.justify") {
      uikContainerTextProps.textalign = TextAlign.justify;
    }
  }

  final String? fontFamily = jsonConvert.convert<String>(json['fontFamily']);
  if (fontFamily != null) {
    uikContainerTextProps.fontFamily = fontFamily;
  }
  final double? width = jsonConvert.convert<double>(json['width']);
  if (width != null) {
    uikContainerTextProps.width = width;
  } else {
    uikContainerTextProps.width = null;
  }

  final String? maxwidth = jsonConvert.convert<String>(json['width']);
  if (maxwidth != null) {
    if (maxwidth == "max") {
      uikContainerTextProps.width = double.maxFinite;
    }
  }

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

  final bool? isCenter = jsonConvert.convert<bool>(json['isCenter']);
  if (isCenter != null) {
    uikContainerTextProps.isCenter = isCenter;
  }

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