toJson method

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

Implementation

@override
Map<String, dynamic> toJson() {
  Map<String, dynamic> jsonObject = {};

  List creds = [];
  for (var c in credentials) {
    creds.add(c.toJson());
  }
  jsonObject['credentials'] = creds;
  if (submissionRequirement != null) {
    jsonObject['submissionRequirement'] = submissionRequirement!.toJson();
  }

  jsonObject['matchingDescriptorIds'] = matchingDescriptorIds;

  if (selfIssuable != null && selfIssuable!.isNotEmpty) {
    List self = [];
    for (var i in selfIssuable!) {
      self.add(i.toJson());
    }
    jsonObject['selfIssuable'] = self;
  }

  jsonObject['fulfilled'] = fulfilled;

  return jsonObject;
}