i tried to show a dialog box to users if in case a newer version is released.I have used new_version package version : 0.3.0. But im recieving a warning.
void _checkVersion()async{
final newVersion=NewVersion(
final status=await newVersion.getVersionStatus();
if(status?.canUpdate==true){
newVersion.showUpdateDialog(
context: context,
versionStatus: status!,
allowDismissal: false,
dialogTitle: "UPDATE",
dialogText: "Please update the app from ${status.localVersion} to ${status.storeVersion}",
);}}

Anyone who still faces this issue can try a new package new_version_plus, you can use the same code by just changing the name, it works completely fine.
you are missing the package name as value in androidId key if working on android to let the new Version function check and compare .Below is the Updated code
void _checkVersion()async{
final newVersion=NewVersion(
androidId: "com.snapchat.android",
);
final status=await newVersion.getVersionStatus();
if(status?.canUpdate==true){
newVersion.showUpdateDialog(
context: context,
versionStatus: status!,
allowDismissal: false,
dialogTitle: "UPDATE",
dialogText: "Please update the app from ${status.localVersion} to ${status.storeVersion}",
);}}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With