final appleId = '284882215'; // If this value is null, its packagename will be consideredfinal playStoreId = 'com.facebook.katana'; // If this value is null, its packagename will be consideredawaitAppVersionUpdate.checkForUpdates(
appleId: appleId, playStoreId: playStoreId)
.then((data) async {
print(data.storeUrl);
print(data.storeVersion);
if(data.canUpdate!){
//showDialog(... your custom widgets view) //or use our widgets// AppVersionUpdate.showAlertUpdate// AppVersionUpdate.showBottomSheetUpdate// AppVersionUpdate.showPageUpdateAppVersionUpdate.showAlertUpdate(
appVersionResult: data, context: context);
}
});
Customize the Alert Dialog
// you also have some options to customize our Alert Dialog AppUpdateVersion.showAlertUpdate(
{BuildContext? context,
AppVersionResult? appVersionResult,
bool? mandatory = false,
String? title = 'New version available',
TextStyle titleTextStyle =
constTextStyle(fontSize: 24.0, fontWeight: FontWeight.w500),
String? content = 'Would you like to update your application?',
TextStyle contentTextStyle =
constTextStyle(fontSize: 16.0, fontWeight: FontWeight.w400),
ButtonStyle? cancelButtonStyle = constButtonStyle(
backgroundColor: MaterialStatePropertyAll(Colors.redAccent)),
ButtonStyle? updateButtonStyle = constButtonStyle(
backgroundColor: MaterialStatePropertyAll(Colors.green)),
String? cancelButtonText = 'UPDATE LATER',
String? updateButtonText = 'UPDATE',
TextStyle? cancelTextStyle = constTextStyle(color: Colors.white),
TextStyle? updateTextStyle = constTextStyle(color: Colors.white),
Color? backgroundColor = Colors.white})