showAlertDialog static method

dynamic showAlertDialog({
  1. required BuildContext context,
  2. required String message,
  3. void onPressed()?,
})

Implementation

static showAlertDialog({required BuildContext context, required String message, void Function()? onPressed}) async {
  showDialog(
      context: context,
      builder: (BuildContext context) {
        return AlertDialog(
          contentTextStyle: TextStyles.popupText,
          content: Text(message),
          actions: [
            TextButton(
              onPressed: onPressed ?? () => Navigator.of(context).pop(),
              child: const Text('OK'),
            )
          ],
        );
      });
}