$UikIconPropsFromJson function

UikIconProps $UikIconPropsFromJson(
  1. Map<String, dynamic> json
)

Implementation

UikIconProps $UikIconPropsFromJson(Map<String, dynamic> json) {
  final UikIconProps uikButtonProps = UikIconProps();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    uikButtonProps.id = id;
  }
  final String? iconVal = jsonConvert.convert<String>(json['iconVal']);
  final String? fontFamily = jsonConvert.convert<String>(json['fontFamily']);
  if (iconVal != null) {
    uikButtonProps.iconVal =
        IconData(int.parse(iconVal), fontFamily: 'MaterialIcons');
  }
  final double? borderWidth = jsonConvert.convert<double>(json['borderWidth']);
  if (borderWidth != null) {
    uikButtonProps.borderWidth = borderWidth;
  }
  final double? iconSize = jsonConvert.convert<double>(json['iconSize']);

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

  if (padding != null) {
    uikButtonProps.padding = padding;
  }
  final double? borderRadius =
      jsonConvert.convert<double>(json['borderRadius']);
  if (borderRadius != null) {
    uikButtonProps.borderRadius = borderRadius;
  }
  final String? iconColor = jsonConvert.convert<String>(json['iconColor']);
  if (iconColor != null) {
    uikButtonProps.iconColor = iconColor.toColor();
  }
  final String? backgroundColor =
      jsonConvert.convert<String>(json['backgroundColor']);
  if (backgroundColor != null) {
    uikButtonProps.backgroundColor = backgroundColor.toColor();
  }
  final String? borderColor = jsonConvert.convert<String>(json['borderColor']);
  if (borderColor != null) {
    uikButtonProps.borderColor = borderColor.toColor();
  }

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