QueryMessage.fromJson constructor

QueryMessage.fromJson(
  1. dynamic jsonObject
)

Implementation

QueryMessage.fromJson(super.jsonObject) : super.fromJson() {
  if (type != DidcommMessages.discoverFeatureQuery) {
    throw Exception('Wrong message type');
  }
  if (body.containsKey('queries')) {
    var q = body['queries'] as List;
    queries = [];
    for (var query in q) {
      queries.add(Query.fromJson(query));
    }
  } else {
    throw FormatException('queries property is needed in Query Message');
  }
}