showTheDialog method

void showTheDialog({
  1. Key? key,
  2. required BuildContext context,
  3. required String? title,
  4. required String message,
  5. required String? releaseNotes,
  6. required bool canDismissDialog,
  7. required HcUpgradeMessages messages,
})

Show the alert dialog.

Implementation

void showTheDialog({
  Key? key,
  required BuildContext context,
  required String? title,
  required String message,
  required String? releaseNotes,
  required bool canDismissDialog,
  required HcUpgradeMessages messages,
}) {
  if (widget.upgrade.debugLogging) {
    if (kDebugMode) {
      print('hcUpgrade: showTheDialog title: $title');
      print('hcUpgrade: showTheDialog message: $message');
      print('hcUpgrade: showTheDialog releaseNotes: $releaseNotes');
    }
  }

  // Save the date/time as the last time alerted.
  widget.upgrade.saveLastAlerted();

  showDialog(
    barrierDismissible: canDismissDialog,
    context: context,
    builder: (BuildContext context) {
      return WillPopScope(
          onWillPop: () async => onWillPop(),
          child: alertDialog(
            key,
            title ?? '',
            message,
            releaseNotes,
            context,
            widget.dialogStyle == HcUpgradeDialogStyle.cupertino,
            messages,
          ));
    },
  );
}