onCancel method

dynamic onCancel({
  1. dynamic result,
})

Handler to close the picker

Implementation

onCancel({var result}) {
  if (widget.onCancel != null) {
    widget.onCancel!();
    return;
  }

  if (!widget.isInlineWidget) {
    Navigator.of(context).pop(result);
  }
}