confirm function

Future<bool> confirm(
  1. BuildContext context, {
  2. String? title,
  3. String? message,
  4. bool? isPositiveButtonVisible,
  5. String? positiveActionTitle,
  6. String? negativeActionTitle,
})

Implementation

Future<bool> confirm(
  BuildContext context, {
  String? title,
  String? message,
  bool? isPositiveButtonVisible,
  String? positiveActionTitle,
  String? negativeActionTitle,
}) async {
  var confirmedType = await showConfirmDialog(
    context,
    title: title,
    body: message,
    isPositiveButtonVisible: isPositiveButtonVisible,
    positiveAction: positiveActionTitle,
    negativeAction: negativeActionTitle,
  );

  return confirmedType == ConfirmTypes.approve;
}