You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’ve encountered an issue with the barrierDismissible parameter in the UpgradeAlert widget not working as expected. The issue seems to stem from the onCanPop function in the upgrade_alert.dart file, which is always returning false, preventing the dialog from being dismissed.
Here’s the relevant part of the onCanPop function:
bool onCanPop() {
if (widget.upgrader.state.debugLogging) {
print('upgrader: onCanPop called');
}
if (widget.shouldPopScope != null) {
final should = widget.shouldPopScope!();
if (widget.upgrader.state.debugLogging) {
print('upgrader: shouldPopScope=$should');
}
return should;
}
return false;
}
Solution:
By making a small change to the onCanPop function, I was able to get barrierDismissible working properly. The key change is to return the widget.barrierDismissible value instead of always returning false:
bool onCanPop() {
if (widget.upgrader.state.debugLogging) {
print('upgrader: onCanPop called');
}
if (widget.shouldPopScope != null) {
final should = widget.shouldPopScope!();
if (widget.upgrader.state.debugLogging) {
print('upgrader: shouldPopScope=$should');
}
return should;
}
return widget.barrierDismissible;
}
With this modification, the barrierDismissible parameter now works as expected.
Is this a bug? Or did you do this intentionally? If so, why did you include the barrierDismissible parameter as an assignable value?
Good luck :)
The text was updated successfully, but these errors were encountered:
I’ve encountered an issue with the barrierDismissible parameter in the UpgradeAlert widget not working as expected. The issue seems to stem from the onCanPop function in the upgrade_alert.dart file, which is always returning false, preventing the dialog from being dismissed.
Here’s the relevant part of the onCanPop function:
bool onCanPop() {
if (widget.upgrader.state.debugLogging) {
print('upgrader: onCanPop called');
}
if (widget.shouldPopScope != null) {
final should = widget.shouldPopScope!();
if (widget.upgrader.state.debugLogging) {
print('upgrader: shouldPopScope=$should');
}
return should;
}
return false;
}
Solution:
By making a small change to the onCanPop function, I was able to get barrierDismissible working properly. The key change is to return the widget.barrierDismissible value instead of always returning false:
bool onCanPop() {
if (widget.upgrader.state.debugLogging) {
print('upgrader: onCanPop called');
}
if (widget.shouldPopScope != null) {
final should = widget.shouldPopScope!();
if (widget.upgrader.state.debugLogging) {
print('upgrader: shouldPopScope=$should');
}
return should;
}
return widget.barrierDismissible;
}
With this modification, the barrierDismissible parameter now works as expected.
Is this a bug? Or did you do this intentionally? If so, why did you include the barrierDismissible parameter as an assignable value?
Good luck :)
The text was updated successfully, but these errors were encountered: