toJson method

  1. @override
Map<String, dynamic> toJson()
override

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

Implementation

@override
Map<String, dynamic> toJson() {
  Map<String, dynamic> json = {'type': strType};

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

  json[strType] = {'options': options.map((e) => e.toJson()).toList()};

  return json;
}