OKOption constructor

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

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

Implementation

OKOption({Key? key, VoidCallback? onPressed})
    : super(
        key: key,
        text: 'OK',
        onPressed: () {
          if (onPressed != null) {
            onPressed();
          }
        },
        result: true,
      );