Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter: UpgradeAlert works OK, but with "upgrader: ..." parameter NOT?

When the code is:

UpgradeAlert(
    child: Scaffold...
  )

Application detects new version in PlayStore and shows prompt.

When I add parameters:

UpgradeAlert(
  upgrader: Upgrader( messages: UpgraderMessages(code: 'pl'),
            showLater: false,
            showIgnore: false,
            durationUntilAlertAgain: Duration(minutes: 1), ),

child: Scaffold... )

Application stops showing update alert, why?

Without "upgrader: Upgrader(...)," line works perfectly.

enter image description here

like image 815
Filip Wajs Avatar asked Dec 28 '25 06:12

Filip Wajs


1 Answers

I solved the problem, when I declare parameters in variable:

    var upgrader = Upgrader(
  showLater: false,
  showReleaseNotes: false,
  messages: MessagesUpgrader(),
)

and...

UpgradeAlert(
  upgrader: upgrader,

Instead of placing it directly in UpgradeAlert

 UpgradeAlert(
  upgrader: Upgrader( messages: UpgraderMessages(code: 'pl'),
            showLater: false,
            showIgnore: false,
            durationUntilAlertAgain: Duration(minutes: 1), ),
child: Scaffold... )
like image 123
Filip Wajs Avatar answered Dec 30 '25 23:12

Filip Wajs



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!