onWillPop method

bool onWillPop()

Called when the user taps outside of the dialog and canDismissDialog is false. Also called when the back button is pressed. Return true for the screen to be popped. Defaults to false.

Implementation

bool onWillPop() {
  if (widget.upgrade.debugLogging) {
    if (kDebugMode) {
      print('hcUpgrade: onWillPop called');
    }
  }
  if (widget.shouldPopScope != null) {
    final should = widget.shouldPopScope!();
    if (widget.upgrade.debugLogging) {
      if (kDebugMode) {
        print('hcUpgrade: shouldPopScope=$should');
      }
    }
    return should;
  }

  return false;
}