The function that will be called by cancel.
If this value is null, nothing will happen when the cancel method is called.
null
final TaskFunction? onCancel;