toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() => {
      'role': role.name,
      if (glintId != null) 'glintId': glintId,
      if (affordances.isNotEmpty) 'affordances': affordances.map((a) => a.name).toList(),
      ..._extraJson(),
      if (inert != null) 'inert': inert!.name,
      if (children.isNotEmpty) 'children': children.map((c) => c.toJson()).toList(),
    };