toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  var name = this.name;
  var color = this.color;
  var id = this.id;

  final json = <String, Object?>{};
  if (name != null) {
    json[r'name'] = name;
  }
  if (color != null) {
    json[r'color'] = color;
  }
  if (id != null) {
    json[r'id'] = id;
  }
  return json;
}