toJson method

Map<String, Object?> toJson()

Implementation

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

  final json = <String, Object?>{};
  if (color != null) {
    json[r'color'] = color;
  }
  if (position != null) {
    json[r'position'] = position.toJson();
  }
  if (title != null) {
    json[r'title'] = title;
  }
  return json;
}