onCancel property

(void Function(RPTaskResult? result)?) onCancel
final

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 optional. If not provided (is null) the survey just stops without doing anything with the result.

Implementation

final void Function(RPTaskResult? result)? onCancel;