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 super.from,
    this.goalCode,
    this.goal,
    this.accept = const [DidcommProfiles.v2],
    super.attachments,
    super.replyUrl,
    super.replyTo,
    super.parentThreadId,
    super.threadId,
    List<String>? super.to,
    super.createdTime,
    super.expiresTime,
    super.pleaseAck,
    super.fromPrior,
    super.additionalHeaders,
    DidcommMessageTyp? typ,
    super.webRedirect,
    super.returnRoute})
    : super(
          id: id ?? Uuid().v4(),
          type: DidcommMessages.invitation,
          body: {},
          typ: DidcommMessageTyp.plain) {
  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;
}