onRequestCancelled method
void
onRequestCancelled( - dynamic event
)
Implementation
void onRequestCancelled(VerificationEvent event) {
_log.info('emitter request.cancelled');
if (flowId == null) {
return; // already finished due to sas.cancelled happened just before
}
setState(() => flowId = null);
// close dialog from previous stage, ex: request.transitioned
final nav = Navigator.of(context, rootNavigator: true);
if (nav.canPop()) nav.pop();
// [ref] https://spec.matrix.org/unstable/client-server-api/#mkeyverificationcancel
var reason = event.getContent('reason');
if (reason == 'Unknown cancel reason') {
reason = null;
}
// open request.cancel dialog
showModalBottomSheet(
context: context,
builder: (BuildContext context) => RequestCancelledView(
sender: event.sender(),
isVerifier: isVerifier,
message: reason,
onDone: onFlowFinished,
),
isDismissible: false,
);
}