showConfirmationDialog method

bool showConfirmationDialog(
  1. String title,
  2. String text, {
  3. int flags = MESSAGEBOX_STYLE.MB_ICONQUESTION,
  4. bool okCancel = false,
  5. bool yesNo = true,
  6. bool cancel = false,
  7. bool modal = false,
})

Shows a confirmation dialog.

Implementation

bool showConfirmationDialog(String title, String text,
    {int flags = MESSAGEBOX_STYLE.MB_ICONQUESTION,
    bool okCancel = false,
    bool yesNo = true,
    bool cancel = false,
    bool modal = false}) {
  if (okCancel) {
    flags |= MESSAGEBOX_STYLE.MB_OKCANCEL;
  } else if (yesNo) {
    flags |=
        cancel ? MESSAGEBOX_STYLE.MB_YESNOCANCEL : MESSAGEBOX_STYLE.MB_YESNO;
  }

  return showDialog(title, text, flags: flags, modal: modal) ==
      MESSAGEBOX_RESULT.IDYES;
}