$UikSearchPropsFromJson function
Implementation
UikSearchProps $UikSearchPropsFromJson(Map<String, dynamic> json) {
final UikSearchProps uikSearchProps = UikSearchProps();
final String? id = jsonConvert.convert<String>(json['id']);
if (id != null) {
uikSearchProps.id = id;
}
final String? label = jsonConvert.convert<String>(json['label']);
if (label != null) {
uikSearchProps.label = label;
}
final String? apiLink = jsonConvert.convert<String>(json['apiLink']);
if (apiLink != null) {
uikSearchProps.apiLink = apiLink;
}
final double? leftMargin = jsonConvert.convert<double>(json['leftMargin']);
if (leftMargin != null) {
uikSearchProps.leftMargin = leftMargin;
}
final double? rightMargin = jsonConvert.convert<double>(json['rightMargin']);
if (rightMargin != null) {
uikSearchProps.rightMargin = rightMargin;
}
final double? topMargin = jsonConvert.convert<double>(json['topMargin']);
if (topMargin != null) {
uikSearchProps.topMargin = topMargin;
}
final double? bottomMargin =
jsonConvert.convert<double>(json['bottomMargin']);
if (bottomMargin != null) {
uikSearchProps.bottomMargin = bottomMargin;
}
final double? width = jsonConvert.convert<double>(json['width']);
if (width != null) {
uikSearchProps.width = width;
}
final double? height = jsonConvert.convert<double>(json['height']);
if (height != null) {
uikSearchProps.height = height;
}
final double? borderRadius =
jsonConvert.convert<double>(json['borderRadius']);
if (borderRadius != null) {
uikSearchProps.borderRadius = borderRadius;
}
final double? labelFontSize =
jsonConvert.convert<double>(json['labelFontSize']);
if (labelFontSize != null) {
uikSearchProps.labelFontSize = labelFontSize;
}
final String? borderColor = jsonConvert.convert<String>(json['borderColor']);
if (borderColor != null) {
uikSearchProps.borderColor = Color(int.parse(borderColor));
}
final String? frontSearchIcon =
jsonConvert.convert<String>(json['frontSearchIcon']);
if (frontSearchIcon != null) {
uikSearchProps.frontSearchIcon = UikIcon(
WidgetType.UikText, UikIconProps.fromJson(json['frontSearchIcon']));
}
// final String? frontArrowIcon =
// jsonConvert.convert<String>(json['frontArrowIcon']);
// print(json['frontArrowIcon']['iconVal']);
// if (frontArrowIcon != null) {
// uikSearchProps.frontArrowIcon = UikIcon(
// WidgetType.UikText, UikIconProps.fromJson(json['frontArrowIcon']));
// print(uikSearchProps.frontArrowIcon);
// }
final String? rightIcon = jsonConvert.convert<String>(json['rightIcon']);
if (rightIcon != null) {
uikSearchProps.rightIcon =
UikIcon(WidgetType.UikText, UikIconProps.fromJson(json['rightIcon']));
}
final String? frontArrowIcon =
jsonConvert.convert<String>(json['frontArrowIcon']);
if (frontArrowIcon != null) {
uikSearchProps.frontArrowIcon = UikIcon(
WidgetType.UikText, UikIconProps.fromJson(json['frontArrowIcon']));
}
final String? text = jsonConvert.convert<String>(json['text']);
if (text != null) {
uikSearchProps.text = text;
}
final bool? micIcon = jsonConvert.convert<bool>(json['micIcon']);
if (micIcon != null) {
uikSearchProps.micIcon = micIcon;
}
final UikAction? action = jsonConvert.convert<UikAction>(json['action']);
if (action != null) {
uikSearchProps.action = action;
}
return uikSearchProps;
}