Skip to content

Dialog

Modal dialog boxes for user interactions and confirmations.

Installation

bash
flutter_studio add dialog
bash
flutter pub add flutter_studio

Usage

dart
CustomDialog.show(
  context,
  title: 'Confirm Delete',
  content: 'Are you sure you want to delete this item?',
  actions: [
    DialogAction(
      label: 'Cancel',
      onPressed: () => Navigator.pop(context),
    ),
    DialogAction(
      label: 'Delete',
      isDestructive: true,
      onPressed: () {
        // Handle delete
        Navigator.pop(context);
      },
    ),
  ],
)

API Reference

Properties

PropertyTypeDefaultDescription
titleStringrequiredDialog title
contentStringrequiredDialog content
actionsList[]Action buttons