toJson method

Map<String, dynamic> toJson()

Convert this to a valid json representation for the Notion API.

Implementation

Map<String, dynamic> toJson() {
  Map<String, dynamic> json = {
    'name': name,
    'color': colorTypeToString(color),
  };

  if (id != null) {
    json['id'] = id;
  }

  return json;
}