alertDialog function

Future alertDialog({
  1. String title = 'Alert',
  2. String content = 'Alert message',
  3. Function? confirm,
})

Implementation

Future<dynamic> alertDialog({
  String title = 'Alert',
  String content = 'Alert message',
  Function? confirm,
}) async {
  return _createDialog(
    title: title,
    content: content,
    actions: [
      Button(
        label: 'OK',
        backgroundColor: Colors.red,
        color: Colors.white,
        borderRadius: 10,
        borderColor: Colors.black,
        onClick: (_) {
          Get.back(result: true);
          if (confirm != null) confirm();
        },
      ),
    ],
  );
}