showAlert static method

void showAlert(
  1. String title,
  2. String message
)

Show an alert dialog with a title and message.

Implementation

static void showAlert(String title, String message) {
  showDialog(
    context: Get.context!,
    builder: (BuildContext context) {
      return AlertDialog(
        title: Text(title),
        content: Text(message),
        actions: [
          TextButton(
            onPressed: () => Navigator.of(context).pop(),
            child: const Text('OK'),
          ),
        ],
      );
    },
  );
}