# Dialog Utilities

SST Base provides reusable dialog utilities to simplify creation of custom, animated, and themed
dialogs in your Flutter app.

## Key Functions

| Function                                | Description                                                                 |
|-----------------------------------------|-----------------------------------------------------------------------------|
| `isDialogShowing(BuildContext context)` | Checks if a dialog is currently visible. Useful to avoid duplicate dialogs. |
| `hideDialog(BuildContext context)`      | Hides the currently shown dialog.                                           |
| `baseDialog(...)`                       | Displays a dialog with customizable style, size, and animation.             |
| `showDialogWithAnimation(...)`          | Displays any widget as a dialog with fade animation.                        |
| `showInfoDialog(...)`                   | Shows a themed informational dialog with optional callbacks.                |
| `showSelectLanguageDialog(...)`         | Shows a dialog for selecting app language.                                  |
| `showProgressDialog(...)`               | Shows a loading dialog with optional message.                               |
| `showConfirmDialog(...)`                | Shows a customizable confirmation dialog with positive/negative actions.    |
| `showUnlockFeatureDialog(...)`          | Shows a dialog for unlocking features via in-app purchases.                 |
| `showCustomDialog(...)`                 | Shows a fully customizable dialog.                                          |

---

## Example Usage

```dart
import 'package:utility_tools/dialog_utils.dart';
import 'package:flutter/material.dart';

showInfoDialog
(
context,
theme: myTheme,
message: "Hello World",
);
```

---

## Example — Confirmation Dialog

```dart
showConfirmDialog
(
context,
theme: myTheme,
title: "Confirm Action",
message: "Do you want to proceed?",
positiveText: "Yes",
negativeText: "No",
onPositivePressed: () {
// Handle confirmation
},
onNegativePressed: () {
// Handle cancellation
},
);
```

---

## Example — Unlock Feature Dialog

```dart
showUnlockFeatureDialog
(
context,
theme: myTheme,
product: productDetails,
onPurchasePressed: () {
// Handle purchase
},
onClosePressed: () {
hideDialog(context);
},
);
```

---

## Internal Helpers

- `_titleWidget` — Builds a styled dialog title widget.
- `_messageWidget` — Builds a styled message widget.
- `_button` — Builds a styled dialog action button.

---