Open alexlozdev opened 4 months ago
@alexlozdev I updated the example/main.dart file with these options and it works for me. Is there more information you can provide about this? Do you have the upgrader log?
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Upgrader Example',
home: UpgradeAlert(
showIgnore: false,
showReleaseNotes: false,
upgrader: Upgrader(
debugLogging: true,
debugDisplayAlways: true,
durationUntilAlertAgain: const Duration(seconds: 30),
),
child: Scaffold(
appBar: AppBar(title: const Text('Upgrader Example')),
body: const Center(child: Text('Checking...')),
),
),
);
}
@alexlozdev I updated the example/main.dart file with these options and it works for me. Is there more information you can provide about this? Do you have the upgrader log?
@override Widget build(BuildContext context) { return MaterialApp( title: 'Upgrader Example', home: UpgradeAlert( showIgnore: false, showReleaseNotes: false, upgrader: Upgrader( debugLogging: true, debugDisplayAlways: true, durationUntilAlertAgain: const Duration(seconds: 30), ), child: Scaffold( appBar: AppBar(title: const Text('Upgrader Example')), body: const Center(child: Text('Checking...')), ), ), ); }
Can you see upgrade alert every 30s if you clicked "Later"?
@alexlozdev Yes, I do see the alert again after the duration expires. Note that the alert doesn't just pop up after 30 seconds. The upgrader code only runs upon app startup and after returning from the background. So, after 30 seconds, background the app and return to the app, and you will see the alert. You do not want upgrader to be running all the time and you would not want the alert to pop up in the middle of a critical user experience.
I found the issue reason This code doesn't work.
UpgradeAlert(
showIgnore: false,
showReleaseNotes: false,
upgrader: Upgrader(
debugLogging: true,
debugDisplayAlways: true,
durationUntilAlertAgain: const Duration(seconds: 30),
),
child: Scaffold(
appBar: AppBar(title: const Text('Upgrader Example')),
body: const Center(child: Text('Checking...')),
),
),
This code works well
final _upgrader = Upgrader(
debugLogging: true,
debugDisplayAlways: true,
durationUntilAlertAgain: const Duration(seconds: 30),
);
Widget build() {
UpgradeAlert(
showIgnore: false,
showReleaseNotes: false,
upgrader: _upgrader,
child: Scaffold(
appBar: AppBar(title: const Text('Upgrader Example')),
body: const Center(child: Text('Checking...')),
),
),
}
I think that Upgrader() has async code, So if it creates Upgrader() previously, it works well. If not, it doesn't work properly.
Flutter sdk 3.19.0 upgrader: ^9.0.0 OS: android
Even, it doesn't display the upgradeAlert.
This works without specifying upgrader.
I tested every code after uninstalling app fully.