$UikDropDownPropsFromJson function

UikDropDownProps $UikDropDownPropsFromJson(
  1. Map<String, dynamic> json
)

Implementation

UikDropDownProps $UikDropDownPropsFromJson(Map<String, dynamic> json) {
  final UikDropDownProps uikDropDownProps = UikDropDownProps();

  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    uikDropDownProps.id = id;
  }
  final String? mainIcon = jsonConvert.convert<String>(json['mainIcon']);
  final String? subIcon1 = jsonConvert.convert<String>(json['subIcon1']);
  final String? subIcon2 = jsonConvert.convert<String>(json['subIcon2']);
  if (mainIcon != null) {
    uikDropDownProps.mainIcon =
        IconData(int.parse(mainIcon), fontFamily: 'MaterialIcons');
  }
  if (subIcon1 != null) {
    uikDropDownProps.subIcon1 =
        IconData(int.parse(subIcon1), fontFamily: 'MaterialIcons');
  }
  if (subIcon2 != null) {
    uikDropDownProps.subIcon2 =
        IconData(int.parse(subIcon2), fontFamily: 'MaterialIcons');
  }

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

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

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

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

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

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