showQuestionMessage static method

dynamic showQuestionMessage({
  1. required BuildContext context,
  2. String? title,
  3. String? message,
  4. Widget? content,
  5. bool autoPop = true,
  6. Function? onAccept,
  7. Function? onReject,
  8. bool barrierDismissible = true,
})

Implementation

static showQuestionMessage({
  required BuildContext context,
  final String? title,
  final String? message,
  final Widget? content,
  final bool autoPop = true,
  final Function? onAccept,
  final Function? onReject,
  final bool barrierDismissible = true,
}) {
  return showConfirmDialog(
    context: context,
    buttonLeft: 'No',
    buttonRight: 'Yes',
    title: title,
    message: message,
    content: content,
    autoPop: autoPop,
    onPressed: (index) {
      if (index == 1 && onAccept != null) {
        onAccept();
      } else if (index == 0 && onReject != null) {
        onReject();
      }
    },
    barrierDismissible: barrierDismissible,
  );
}