CancelOption constructor

CancelOption({
  1. Key? key,
  2. VoidCallback? onPressed,
})

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

Implementation

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