onCancel property
The callback function which has to return an RPTaskResult object. This function is called when the participant cancels a survey. The result parameter is optional so if you don't want to do grab the result as part of the callback function you can do so, like the following:
onCancel: ([result]) {
cancelCallBack();
},
It's only optional. If nothing is provided (is null
) the survey just quits without doing anything with the result.
Implementation
final void Function(RPTaskResult? result)? onCancel;