import 'package:flutter/material.dart';

Future<bool> showNotAllowedDialog(
  BuildContext context, {
  String? message,
}) async {
  return await showDialog<bool>(
        context: context,
        barrierDismissible: false, // Force user to choose
        builder: (context) {
          return AlertDialog(
            title: const Text('Notice'),
            content: Text(
              message ?? 'This class is not allowed. Do you want to continue?',
            ),
            actions: [
              TextButton(
                onPressed: () => Navigator.of(context).pop(false), // Cancel
                child: const Text('Cancel'),
              ),
              ElevatedButton(
                onPressed: () => Navigator.of(context).pop(true), // OK
                child: const Text('OK'),
              ),
            ],
          );
        },
      ) ??
      false; // Default to false if dialog is dismissed
}
