toJson method

Map<String, dynamic> toJson()

Converts the collection to a JSON map.

The resulting map matches Figma's API format and can be used for serialization or API requests.

Implementation

Map<String, dynamic> toJson() => {
      'id': id,
      'name': name,
      'modes': modes.map((mode) => mode.toJson()).toList(),
      'variableIds': variableIds,
      'defaultModeId': defaultModeId,
    };