updateGenericDialog method
Implementation
Future<Widget?> updateGenericDialog(context) {
return showDialog(
context: context,
barrierDismissible: barrierDismissible,
builder: (BuildContext context) {
return WillPopScope(
onWillPop: () => _onWillPopState(context),
child: AlertDialog(
backgroundColor: backgroundColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(dialogRadius)),
title: Text(
title,
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(
onPressed:
onPressDecline ?? () => Navigator.of(context).pop(),
style: ElevatedButton.styleFrom(
foregroundColor: updateButtonColor ?? Colors.blue,
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(updateButtonRadius ?? 10),
)),
child: new Text(laterButtonText,
style:
TextStyle(color: laterButtonColor ?? Colors.black)),
),
),
ElevatedButton(
onPressed:
onPressConfirm ?? () => Navigator.of(context).pop(),
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(updateButtonRadius ?? 10),
),
backgroundColor: updateButtonColor ?? Colors.blue,
),
child: Text(
updateButtonText,
style: TextStyle(
color: updateButtonTextColor,
fontWeight: FontWeight.bold),
),
),
],
),
);
});
}