CancelOption constructor

CancelOption({
  1. VoidCallback? onPressed,
})

Supply the optionally Callback when pressed. Assigns a boolean False to the result property.

Implementation

CancelOption({VoidCallback? onPressed})
    : super(
        text: 'Cancel',
        onPressed: () {
          if (onPressed != null) {
            onPressed();
          }
        },
        result: false,
      );