alertDialogWithTwoAction function
void
alertDialogWithTwoAction()
Implementation
void alertDialogWithTwoAction(BuildContext context, bool isPlatformIOS, String title, String description,String confirmationText, String declineText, Function() onTapConfirm, Function() onTapDecline) {
if (isPlatformIOS) {
showCupertinoDialog(
context: context,
builder: (ctx) => CupertinoAlertDialog(
title: Text(title),
content: Text(description),
actions: [
TextButton(
onPressed: onTapConfirm,
child: Text(confirmationText),
),
TextButton(
onPressed: onTapDecline,
child: Text(declineText),
),
],
));
} else {
showDialog(
context: context,
builder: (ctx) => AlertDialog(
title: Text(title),
content: Text(description),
actions: [
TextButton(
onPressed: onTapConfirm,
child: Text(confirmationText),
),
TextButton(
onPressed: onTapDecline,
child: Text(declineText),
),
],
),
);
}
}