upgrader
upgrader copied to clipboard
Forced upgrade should have a different title and text
When setting Minimum App Version the user is still asked kindly if he/she wants to update the app, even though there's no other option. The text should indicate that the user needs to upgrade to continue using the app when that's the case.
how to enable force upgrade??
I wanted the same feature for my app and its solution is very simple. What I did, I added UpgradeAlert in my splash screen. User will be asked to update app on the splash screen and i restricted user to enter in the app. User will have to update app or close app and whenever user will launch app again dialog will pop up.
UpgradeAlert(
upgrader: Upgrader(
durationUntilAlertAgain: Duration(seconds: 1),
dialogStyle: UpgradeDialogStyle.cupertino,
canDismissDialog: controller.canDismissDialog.value,
showIgnore: false,
showLater: false,
showReleaseNotes: true,
shouldPopScope: (){
controller.closeApp();
return true;
},
willDisplayUpgrade: ({String? appStoreVersion,bool? display,String? installedVersion,String? minAppVersion}){
if(display != null){
controller.willShowUpgradeDialog = display;
}
controller.checkAndNavigateScreen();
},
onUpdate: (){
controller.closeApp();
return true;
},
),
child: YourWidget(),
)
@kamran8545 That won't show a different title/text depending on if it's a forced or optional upgrade. Actually it seems to not use the force upgrade functionality at all, but instead force the user to upgrade at any new version. Also, the app will close after an update. Instead you should use this https://pub.dev/packages/upgrader#minimum-app-version.
@joymyr Look at the latest version of this package with a latest customization options. I think it now meets your needs. If not, please open a new issue with your details.