showPermanentlyDeniedDialog method

Future<void> showPermanentlyDeniedDialog({
  1. required String title,
  2. required String description,
  3. String? settingsButtonText,
  4. String? cancelButtonText,
})

Implementation

Future<void> showPermanentlyDeniedDialog({
  required String title,
  required String description,
  String? settingsButtonText,
  String? cancelButtonText,
}) async {
  await Get.dialog(
    Dialog(
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(16),
      ),
      child: Padding(
        padding: const EdgeInsets.all(24),
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            Icon(
              Icons.security,
              size: 50,
              color: AppColors.error,
            ),
            const SizedBox(height: 16),
            Text(
              title,
              style: TextStyle(
                fontSize: 18,
                fontWeight: FontWeight.bold,
              ),
              textAlign: TextAlign.center,
            ),
            const SizedBox(height: 16),
            Text(
              description,
              style: TextStyle(fontSize: 14),
              textAlign: TextAlign.center,
            ),
            const SizedBox(height: 24),
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              children: [
                Button(
                  text: cancelButtonText ?? 'Cancel',
                  type: ButtonType.outlined,
                  onPressed: () => Get.back(),
                ),
                Button(
                  text: settingsButtonText ?? 'Open Settings',
                  type: ButtonType.primary,
                  onPressed: () {
                    Get.back();
                    openAppSettings();
                  },
                ),
              ],
            ),
          ],
        ),
      ),
    ),
    barrierDismissible: false,
  );
}