showSelectedOptionDialog method

void showSelectedOptionDialog(
  1. String selectedOption
)

Implementation

void showSelectedOptionDialog(String selectedOption) {
  showDialog(
    context: navigatorKey.currentContext!,
    builder: (BuildContext context) {
      return Dialog(
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.circular(16.0),
        ),
        child: Container(
          padding: const EdgeInsets.all(20.0),
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              // Custom Image or Icon
              const Icon(
                  FontAwesomeIcons
                      .solidThumbsUp, // You can change this to any other icon
                  color: Colors.redAccent,
                  size: 80 // Adjust the size as needed,
                  ),
              const SizedBox(height: 20),
              const Text(
                'Thank You for Your Response!',
                style: TextStyle(
                  fontSize: 30,
                  fontWeight: FontWeight.bold,
                  color: Colors.black87,
                ),
                textAlign: TextAlign.center,
              ),
              const SizedBox(height: 20),
              Text(
                'You selected: $selectedOption',
                style: const TextStyle(
                  fontSize: 20,
                  color: Colors.black54,
                ),
                textAlign: TextAlign.center,
              ),
              const SizedBox(height: 20),
              TextButton(
                child: const Text(
                  'OK',
                  style: TextStyle(fontSize: 20, color: Colors.indigo),
                ),
                onPressed: () {
                  Navigator.of(context).pop(); // Close the dialog
                },
              ),
              const SizedBox(height: 20),
            ],
          ),
        ),
      );
    },
  );
}