this code works
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}",
);}}
but this code is not working
void _checkVersion()async{
final newVersion=NewVersion(
androidId: "com.whatsapp",
);
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}",
);}}
E/flutter ( 2974): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: NoSuchMethodError: The method '[]' was called on null. E/flutter ( 2974): Receiver: null
Please can you help me ?