$UikAccountCompletionPropsFromJson function
Implementation
UikAccountCompletionProps $UikAccountCompletionPropsFromJson(
Map<String, dynamic> json) {
final UikAccountCompletionProps uikAccountCompletionProps =
UikAccountCompletionProps();
final String? id = jsonConvert.convert<String>(json['id']);
if (id != null) {
uikAccountCompletionProps.id = id;
}
final double? width = jsonConvert.convert<double>(json['width']);
if (width != null) {
uikAccountCompletionProps.width = width;
}
final double? horizontalPadding =
jsonConvert.convert<double>(json['horizontalPadding']);
if (horizontalPadding != null) {
uikAccountCompletionProps.horizontalPadding = horizontalPadding;
}
final double? verticalPadding =
jsonConvert.convert<double>(json['verticalPadding']);
if (verticalPadding != null) {
uikAccountCompletionProps.verticalPadding = verticalPadding;
}
final double? radiusBottomLeft =
jsonConvert.convert<double>(json['radiusBottomLeft']);
if (radiusBottomLeft != null) {
uikAccountCompletionProps.radiusBottomLeft = radiusBottomLeft;
}
final double? radiusTopLeft =
jsonConvert.convert<double>(json['radiusTopLeft']);
if (radiusTopLeft != null) {
uikAccountCompletionProps.radiusTopLeft = radiusTopLeft;
}
final double? radiusBottomRight =
jsonConvert.convert<double>(json['radiusBottomRight']);
if (radiusBottomRight != null) {
uikAccountCompletionProps.radiusBottomRight = radiusBottomRight;
}
final double? radiusTopRight =
jsonConvert.convert<double>(json['radiusTopRight']);
if (radiusTopRight != null) {
uikAccountCompletionProps.radiusTopRight = radiusTopRight;
}
final Map<String, dynamic>? divider =
jsonConvert.convert<Map<String, dynamic>>(json['divider']);
if (divider != null) {
final double? dividerHeight =
jsonConvert.convert<double>(divider['height']);
if (dividerHeight != null) {
uikAccountCompletionProps.dividerHeight = dividerHeight;
}
final String? dividerColor = jsonConvert.convert<String>(json['color']);
if (dividerColor != null) {
uikAccountCompletionProps.dividerColor = dividerColor.toColor();
}
}
final double? leftMargin = jsonConvert.convert<double>(json["leftMargin"]);
if (leftMargin != null) {
uikAccountCompletionProps.leftMargin = leftMargin;
}
final double? rightMargin = jsonConvert.convert<double>(json["rightMargin"]);
if (rightMargin != null) {
uikAccountCompletionProps.rightMargin = rightMargin;
}
final double? topMargin = jsonConvert.convert<double>(json["topMargin"]);
if (topMargin != null) {
uikAccountCompletionProps.topMargin = topMargin;
}
final double? bottomMargin =
jsonConvert.convert<double>(json["bottomMargin"]);
if (bottomMargin != null) {
uikAccountCompletionProps.bottomMargin = bottomMargin;
}
final String? bgImage = jsonConvert.convert<String>(json['bgImage']);
if (bgImage != null) {
uikAccountCompletionProps.bgImage = bgImage;
}
final Map<String, dynamic>? profileImage =
jsonConvert.convert<Map<String, dynamic>>(json['profileImage']);
if (profileImage != null) {
final Map<String, dynamic>? image =
jsonConvert.convert<Map<String, dynamic>>(profileImage['image']);
if (image != null) {
uikAccountCompletionProps.image =
UikAvatar(WidgetType.UikAvatar, UikAvatarProps.fromJson(image));
}
final Map<String, dynamic>? imageSelector = jsonConvert
.convert<Map<String, dynamic>>(profileImage['imageSelector']);
if (imageSelector != null) {
uikAccountCompletionProps.imageSelector =
UikImage(WidgetType.UikAvatar, UikImageProps.fromJson(imageSelector));
}
}
final Map<String, dynamic>? userTextDetails =
jsonConvert.convert<Map<String, dynamic>>(json['userTextDetails']);
if (userTextDetails != null) {
final Map<String, dynamic>? nameText =
jsonConvert.convert<Map<String, dynamic>>(userTextDetails['name']);
if (nameText != null) {
uikAccountCompletionProps.nameText = UikContainerText(
WidgetType.UikAvatar, UikContainerTextProps.fromJson(nameText));
}
final Map<String, dynamic>? mobileText =
jsonConvert.convert<Map<String, dynamic>>(userTextDetails['mobile']);
if (mobileText != null) {
uikAccountCompletionProps.mobileText = UikContainerText(
WidgetType.UikAvatar, UikContainerTextProps.fromJson(mobileText));
}
final Map<String, dynamic>? emailText =
jsonConvert.convert<Map<String, dynamic>>(userTextDetails['email']);
if (emailText != null) {
uikAccountCompletionProps.emailText = UikContainerText(
WidgetType.UikAvatar, UikContainerTextProps.fromJson(emailText));
}
}
final Map<String, dynamic>? percentDetail =
jsonConvert.convert<Map<String, dynamic>>(json['percentDetail']);
if (percentDetail != null) {
final double? percent =
jsonConvert.convert<double>(percentDetail['percent']);
if (percent != null) {
uikAccountCompletionProps.percent = percent;
}
final double? percentFontSize =
jsonConvert.convert<double>(percentDetail['fontSize']);
if (percentFontSize != null) {
uikAccountCompletionProps.percentFontSize = percentFontSize;
}
final double? lineHeight =
jsonConvert.convert<double>(percentDetail['lineHeight']);
if (lineHeight != null) {
uikAccountCompletionProps.lineHeight = lineHeight;
}
final int? duration = jsonConvert.convert<int>(percentDetail['duration']);
if (duration != null) {
uikAccountCompletionProps.duration = duration;
}
final String? percentTextColor =
jsonConvert.convert<String>(percentDetail['textColor']);
if (percentTextColor != null) {
uikAccountCompletionProps.percentTextColor = percentTextColor.toColor();
}
final String? backgroundColor =
jsonConvert.convert<String>(percentDetail['backgroundColor']);
if (backgroundColor != null) {
uikAccountCompletionProps.backgroundColor = backgroundColor.toColor();
}
final String? progressColor =
jsonConvert.convert<String>(percentDetail['progressColor']);
if (progressColor != null) {
uikAccountCompletionProps.progressColor = progressColor.toColor();
}
final String? percentFontWeight =
jsonConvert.convert<String>(percentDetail['fontWeight']);
if (percentFontWeight != null) {
if (percentFontWeight == "medium") {
uikAccountCompletionProps.percentFontWeight = FontWeight.w500;
} else if (percentFontWeight == "regular") {
uikAccountCompletionProps.percentFontWeight = FontWeight.w400;
} else if (percentFontWeight == "light") {
uikAccountCompletionProps.percentFontWeight = FontWeight.w300;
} else if (percentFontWeight == "semiBold") {
uikAccountCompletionProps.percentFontWeight = FontWeight.w600;
}
}
}
final Map<String, dynamic>? completeProfileText =
jsonConvert.convert<Map<String, dynamic>>(json['completeProfileText']);
if (completeProfileText != null) {
uikAccountCompletionProps.completeProfileText = UikContainerText(
WidgetType.UikContainerText,
UikContainerTextProps.fromJson(completeProfileText));
}
final List<dynamic>? tag = jsonConvert.convert<List<dynamic>>(json["tag"]);
if (tag != null) {
uikAccountCompletionProps.length = tag.length;
for (var i = 0; i < tag.length; i++) {
var icons;
var texts;
final Map<String, dynamic>? icon =
jsonConvert.convert<Map<String, dynamic>>(tag[i]['icon']);
if (icon != null) {
icons = UikIcon(WidgetType.UikText, UikIconProps.fromJson(icon));
}
final Map<String, dynamic>? text =
jsonConvert.convert<Map<String, dynamic>>(tag[i]['text']);
if (text != null) {
texts = UikContainerText(
WidgetType.UikText, UikContainerTextProps.fromJson(text));
}
uikAccountCompletionProps.tag.add(TagProps(
icon: icons,
text: texts,
));
}
}
final Map<String, dynamic>? button =
jsonConvert.convert<Map<String, dynamic>>(json['button']);
if (button != null) {
uikAccountCompletionProps.button =
UikButton(WidgetType.UikContainerText, UikButtonProps.fromJson(button));
final double? buttonTopPadding =
jsonConvert.convert<double>(button['buttonTopPadding']);
if (buttonTopPadding != null) {
uikAccountCompletionProps.buttonTopPadding = buttonTopPadding;
}
}
final Map<String, dynamic>? rightImage =
jsonConvert.convert<Map<String, dynamic>>(json['rightImage']);
if (rightImage != null) {
uikAccountCompletionProps.rightImage = UikImage(
WidgetType.UikContainerText, UikImageProps.fromJson(rightImage));
}
return uikAccountCompletionProps;
}