OutOfBandMessage constructor

OutOfBandMessage({
  1. String? id,
  2. required String from,
  3. String? goalCode,
  4. String? goal,
  5. List<DidcommProfiles>? accept = const [DidcommProfiles.v2],
  6. List<Attachment>? attachments,
  7. String? replyUrl,
  8. List<String>? replyTo,
  9. String? parentThreadId,
  10. String? threadId,
  11. List<String>? to,
  12. DateTime? createdTime,
  13. DateTime? expiresTime,
  14. bool pleaseAck = false,
  15. FromPriorJWT? fromPrior,
  16. Map<String, dynamic>? additionalHeaders,
  17. DidcommMessageTyp? typ,
  18. WebRedirect? webRedirect,
  19. ReturnRouteValue? returnRoute,
})

Implementation

OutOfBandMessage(
    {String? id,
    required String from,
    this.goalCode,
    this.goal,
    this.accept = const [DidcommProfiles.v2],
    List<Attachment>? attachments,
    String? replyUrl,
    List<String>? replyTo,
    String? parentThreadId,
    String? threadId,
    List<String>? to,
    DateTime? createdTime,
    DateTime? expiresTime,
    bool pleaseAck = false,
    FromPriorJWT? fromPrior,
    Map<String, dynamic>? additionalHeaders,
    DidcommMessageTyp? typ,
    WebRedirect? webRedirect,
    ReturnRouteValue? returnRoute})
    : super(
          id: id ?? Uuid().v4(),
          type: DidcommMessages.invitation.value,
          body: {},
          typ: DidcommMessageTyp.plain,
          from: from,
          attachments: attachments,
          replyUrl: replyUrl,
          replyTo: replyTo,
          threadId: threadId,
          parentThreadId: parentThreadId,
          to: to,
          createdTime: createdTime,
          expiresTime: expiresTime,
          pleaseAck: pleaseAck,
          fromPrior: fromPrior,
          additionalHeaders: additionalHeaders,
          webRedirect: webRedirect,
          returnRoute: returnRoute) {
  if (goal != null) body['goal'] = goal;
  if (goalCode != null) body['goal_code'] = goalCode;
  List<String> tmp = [];
  for (var p in accept!) {
    tmp.add(p.value);
  }
  body['accept'] = tmp;
}