toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  var id = this.id;
  var styleClass = this.styleClass;
  var iconClass = this.iconClass;
  var label = this.label;
  var title = this.title;
  var href = this.href;
  var weight = this.weight;

  final json = <String, Object?>{};
  if (id != null) {
    json[r'id'] = id;
  }
  if (styleClass != null) {
    json[r'styleClass'] = styleClass;
  }
  if (iconClass != null) {
    json[r'iconClass'] = iconClass;
  }
  if (label != null) {
    json[r'label'] = label;
  }
  if (title != null) {
    json[r'title'] = title;
  }
  if (href != null) {
    json[r'href'] = href;
  }
  if (weight != null) {
    json[r'weight'] = weight;
  }
  return json;
}