butterfly_dialog 0.0.5 copy "butterfly_dialog: ^0.0.5" to clipboard
butterfly_dialog: ^0.0.5 copied to clipboard

ButterflyAlertDialog allows you to quickly display alert dialogs such as success, error, warning, and delete.

Butterfly Alert Dialog #

ButterflyAlertDialog allows you to quickly display alert dialogs such as success, error, warning, and delete.

Features #

Warning Alert Delete Alert
Success Alert Error Alert

Getting started #

start using the package. First, add butterfly_dialog as a dependency in your pubspec.yaml file then run flutter pub get

 dependencies:
  butterfly_dialog:^0.0.3

Usage #

To use this Widget -> i: #Call the widget ButterflyAlertDialog.show()

These are required :
1) context
2) title
3)subtitle
4)alertType
5)onConfirm

For Warning Alert Dialog: AlertType.warning

ButterflyAlertDialog.show(
       context: context,
       title: 'Warning',
       subtitle: 'This is the subtitle of the alert.',
       alertType: AlertType.warning,
       onConfirm: () {
       // Your confirm action here
       },
       
       );

For Delete Alert Dialog: AlertType.delete

 ButterflyAlertDialog.show(
context: context,
title: 'Delete',
subtitle: 'This is the subtitle of the alert.',
alertType: AlertType.delete,
onConfirm: () {
// Your confirm action here
},
);

For Success Alert Dialog: AlertType.success

 ButterflyAlertDialog.show(
context: context,
title: 'Success',
subtitle: 'This is the subtitle of the alert.',
alertType: AlertType.success,
onConfirm: () {
// Your confirm action here
},
);

For Error Alert Dialog: AlertType.error

   ButterflyAlertDialog.show(
   context: context,
   title: 'ERROR',
   subtitle: 'This is the subtitle of the alert.',
   alertType: AlertType.error,
   onConfirm: () {
       // Your confirm action here
    },
  );

},

ButterflyAlertDialog Options 📖 #

These are the options available in ButterflyAlertDialog

Attribute Data type Description Default Value
context BuildContext @required BuildContext N/A
alertType AlertType @required - Type of alert dialog, ex: AlertType.warning for warning dialogs NULL
title String @required Set a custom title for dialog -
subtitle String @required Set a custom subtitle for dialog -
cancelText String Text of cancel button 'cancel'
confirmText String Text of ok button 'ok'
onConfirm Function @required Function that handle click of confirm button
confirmTextStyle TextStyle Confirm button text theme TextStyle(color: Colors.black,fontWeight: FontWeight.bold,)
cancelTextStyle TextStyle cancel button text theme TextStyle(color: Colors.black,fontWeight: FontWeight.bold,)
barrierDismissible bool Dismiss dialog on touch overlay true
backgroundColor Color Color of dialog background Colors.white
titleFontSize double font size of title 20.0
subTitleFontSize double font size od subtitle 16.0

Some thing went wrong 🤔 #

create a new issue

Created & Maintained By #

Muhammad Rifatul Islam

8
likes
150
points
38
downloads

Publisher

unverified uploader

Weekly Downloads

ButterflyAlertDialog allows you to quickly display alert dialogs such as success, error, warning, and delete.

Repository (GitLab)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on butterfly_dialog