updateDialogAndroid method
Implementation
Future<Widget?> updateDialogAndroid(context) {
return showDialog(
context: context,
barrierDismissible: _barrierDismissible ?? true,
builder: (BuildContext context) {
return WillPopScope(
onWillPop: () => _onWillPopState(context),
child: AlertDialog(
backgroundColor: _backgroundColor ?? Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(_dialogRadius ?? 12.0)),
title: Text(
_title ?? 'Update App',
style: TextStyle(color: _titleColor ?? Colors.black),
),
content: Text(
_body ??
'A new version of the app is available ' +
CheckAppVersion().appFile.newAppVersion!,
style: TextStyle(color: _bodyColor ?? Colors.black54)),
actions: <Widget>[
Visibility(
visible: _laterButtonEnable ?? true,
child: TextButton(
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(_updateButtonRadius ?? 10),
),
onPrimary: _updateButtonColor ?? Colors.blue),
onPressed: () => Navigator.pop(context),
child: new Text(_laterButtonText ?? 'Later',
style: TextStyle(
color: _laterButtonColor ?? Colors.black)),
),
),
ElevatedButton(
onPressed: () {
AppInstaller.goStore(CheckAppVersion().appFile.appPackage!,
CheckAppVersion().appFile.appPackage!);
},
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(_updateButtonRadius ?? 10),
),
primary: _updateButtonColor ?? Colors.blue,
),
child: Text(
_updateButtonText ?? "Update",
style: TextStyle(
color: _updateButtonTextColor,
fontWeight: FontWeight.bold),
),
),
],
),
);
});
}