larryaasen / upgrader

A Flutter package for prompting users to upgrade when there is a newer version of the app in the store.
MIT License
526 stars 260 forks source link

[Feature Request] Add onPopDialog parameter #372

Closed AhmedLSayed9 closed 6 months ago

AhmedLSayed9 commented 6 months ago

Use case: I prevent pushing to new screens when the alert dialog is shown. At some scenarios, I'd like to push the previous blocked screen if/when the dialog is popped.

An example is a custom splash screen where the navigation is handled automatically. I'd like to prevent pushing to the next screen until the alert dialog is popped (If it's flexible update).

Using onIgnore/onLater/onUpdate is not ideal, as the dialog is not popped yet and I prevent pushing to new routes when it's shown. Also, onUpdate behavior is different when it's flexible/immediate update so I can't rely on it.

I'd like to open a PR If this is cool, or maybe hear some alternatives :)

AhmedLSayed9 commented 6 months ago

I was able to make this work using the current onIgnore/onLater/onUpdate callbacks so I'll close this.