cyberwizard_custom_dialog 1.0.2 copy "cyberwizard_custom_dialog: ^1.0.2" to clipboard
cyberwizard_custom_dialog: ^1.0.2 copied to clipboard

A customizable Flutter package for displaying beautiful and animated success, error, and warning dialogs.

custom_dialog #

A customizable Flutter package for displaying beautiful and animated success, error, and warning dialogs.

Features #

  • Customizable Dialog Types: Easily display success, error, or warning dialogs.
  • Animated Entry: Dialogs animate into view for a smooth user experience.
  • Customizable Buttons: Set custom text for confirm and cancel buttons.
  • Customizable Colors: Set custom colors for the icon, confirm button, and cancel button.
  • Rounded Corners: Option to display dialogs with rounded corners.
  • Simple API: A straightforward static method to show dialogs.

Getting started #

Add the following to your pubspec.yaml file:

dependencies:
  custom_dialog: ^1.0.3

Then, run flutter pub get to install the package.

Usage #

Import the package:

import 'package:custom_dialog/custom_dialog.dart';

To show a success dialog:

CustomDialog.showCustomDialog(
  context: context,
  dialogType: CustomDialogType.success,
  title: 'Success!',
  description: 'Your operation was completed successfully.',
  onConfirm: () {
    // Handle confirm action
    print('Success confirmed!');
  },
);

To show an error dialog with a cancel button:

CustomDialog.showCustomDialog(
  context: context,
  dialogType: CustomDialogType.error,
  title: 'Error!',
  description: 'Something went wrong. Please try again.',
  onConfirm: () {
    // Handle confirm action
    print('Error acknowledged!');
  },
  onCancel: () {
    // Handle cancel action
    print('Error cancelled!');
  },
  confirmButtonText: 'Got It',
  cancelButtonText: 'Dismiss',
);

To show a warning dialog without rounded corners:

CustomDialog.showCustomDialog(
  context: context,
  dialogType: CustomDialogType.warning,
  title: 'Warning!',
  description: 'This action cannot be undone.',
  onConfirm: () {
    // Handle confirm action
    print('Warning confirmed!');
  },
  rounded: false,
);

Customizing Colors #

You can customize the colors of the icon, confirm button, and cancel button by providing the iconColor, confirmButtonColor, and cancelButtonColor parameters.

CustomDialog.showCustomDialog(
  context: context,
  dialogType: CustomDialogType.success,
  title: 'Custom Colors!',
  description: 'This dialog has custom colors.',
  onConfirm: () {
    // Handle confirm action
    print('Custom colors confirmed!');
  },
  iconColor: Colors.purple,
  confirmButtonColor: Colors.purple,
  cancelButtonColor: Colors.grey,
);

Additional information #

For more information, to contribute, or to file issues, please visit the GitHub repository: https://github.com/cyberwizard-dev/custom_dialog

0
likes
115
points
34
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A customizable Flutter package for displaying beautiful and animated success, error, and warning dialogs.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on cyberwizard_custom_dialog