confirmationDialog static method

dynamic confirmationDialog(
  1. BuildContext context,
  2. String title,
  3. String content,
  4. 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),
                    ),
                  ),
                )
              ],
            ),
          ],
        );
      });
}