$UikTextFieldPropsFromJson function

UikTextFieldProps $UikTextFieldPropsFromJson(
  1. Map<String, dynamic> json
)

Implementation

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

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

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

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

  final String? rightElement =
      jsonConvert.convert<String>(json['rightElement']);
  print(json["rightElement"].runtimeType);
  if (rightElement != null) {
    uikTextFieldProps.rightElement = UikIcon(
        WidgetType.UikText, UikIconProps.fromJson(json['rightElement']));
  }

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

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

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

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

  final double? bottomMargin =
      jsonConvert.convert<double>(json['bottomMargin']);
  if (bottomMargin != null) {
    uikTextFieldProps.bottomMargin = bottomMargin;
  }
  final String? leftElement = jsonConvert.convert<String>(json['leftElement']);
  //print(leftElement);
  if (leftElement != null) {
    uikTextFieldProps.leftElement =
        UikIcon(WidgetType.UikText, UikIconProps.fromJson(json['leftElement']));
  }

  final String? error = jsonConvert.convert<String>(json['error']);
  if (error != null) {
    uikTextFieldProps.error = error.toLowerCase() == 'true';
  }

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