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.
2
Answers
I solved the problem, when I declare parameters in variable:
and...
Instead of placing it directly in UpgradeAlert
I managed to solve my problem by not using localisations.
This is the
UpgradeAlert
I’m using:And this is inside the
MessagesUpgrader()
:Before I had localisations in the
MessagesUpgrader
and I had aBuildContext
to fetch those texts—but if this class doesn’t refresh or rebuild, it works.Not really a solution but a workaround until this issue is fixed.