RequestPresentation constructor
RequestPresentation({
- String? id,
- required List<
PresentationDefinitionWithOptions> presentationDefinition, - bool willConfirm = false,
- String? goalCode,
- String? comment,
- String? replyUrl,
- List<
String> ? replyTo, - String? parentThreadId,
- String? threadId,
- String? from,
- List<
String> ? to, - DateTime? createdTime,
- DateTime? expiresTime,
- bool pleaseAck = false,
- FromPriorJWT? fromPrior,
- Map<
String, dynamic> ? additionalHeaders, - WebRedirect? webRedirect,
- ReturnRouteValue? returnRoute,
- DidcommMessageTyp? typ,
Implementation
RequestPresentation(
{String? id,
required this.presentationDefinition,
this.willConfirm = false,
this.goalCode,
this.comment,
String? replyUrl,
List<String>? replyTo,
String? parentThreadId,
String? threadId,
String? from,
List<String>? to,
DateTime? createdTime,
DateTime? expiresTime,
bool pleaseAck = false,
FromPriorJWT? fromPrior,
Map<String, dynamic>? additionalHeaders,
WebRedirect? webRedirect,
ReturnRouteValue? returnRoute,
DidcommMessageTyp? typ})
: super(
id: id ?? Uuid().v4(),
type: DidcommMessages.requestPresentation.value,
body: {},
replyUrl: replyUrl,
replyTo: replyTo,
threadId: threadId,
parentThreadId: parentThreadId,
from: from,
to: to,
createdTime: createdTime,
expiresTime: expiresTime,
pleaseAck: pleaseAck,
fromPrior: fromPrior,
additionalHeaders: additionalHeaders,
webRedirect: webRedirect,
returnRoute: returnRoute,
typ: typ) {
if (goalCode != null) body['goal_code'] = goalCode;
if (comment != null) body['comment'] = comment;
body['will_confirm'] = willConfirm;
attachments = [];
for (var d in presentationDefinition) {
var attachment = Attachment(
data: AttachmentData(json: d.toJson()),
id: Uuid().v4(),
format: AttachmentFormat.presentationDefinition2.value,
mediaType: 'application/json');
attachments!.add(attachment);
}
}