confirmationDialog static method
dynamic
confirmationDialog(
- BuildContext context,
- String title,
- String content,
- VoidCallback onClick,
Implementation
static confirmationDialog(BuildContext context, String title, String content,
VoidCallback onClick) {
showDialog(
barrierDismissible: false,
context: context,
builder: (_) {
return AlertDialog(
title: Text(title),
content: Text(content),
actions: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
InkWell(
onTap: () {
Get.back();
},
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Text(
"Cancel",
style: TextStyle(color: Colors.black, fontSize: 16),
),
),
),
InkWell(
onTap: onClick,
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Text(
"Yes, proceed",
style: TextStyle(color: Colors.black, fontSize: 16),
),
),
)
],
),
],
);
});
}