toJson method

Map<String, Object> toJson()

Converts a Capabilities instance to JSON data.

Implementation

Map<String, Object> toJson() {
  final jsonData = <String, Object>{};

  final tempAdd = add;
  final tempDrop = drop;

  if (tempAdd != null) {
    jsonData['add'] = tempAdd;
  }

  if (tempDrop != null) {
    jsonData['drop'] = tempDrop;
  }

  return jsonData;
}