0 purchases
alert craft
alert_craft #
alert_craft is a Flutter package for managing various types of overlays and alerts in your Flutter application. It provides a simple API for displaying alert dialogs, loading dialogs, selection dialogs, toast messages, and custom widgets.
Features #
Show Alert Dialog: Display customizable alert dialogs.
Show Loading Dialog: Show a loading indicator.
Show Selection Dialog: Display a dialog with selectable options.
Show Toast Message: Show non-intrusive toast messages.
Show Custom Dialog: Display custom widgets in dialogs.
Show Custom Alert: Display custom alerts with custom widgets.
Close Alert: Close the currently displayed overlay or alert.
Show Alert Dialog #
Displays a customizable alert dialog with a title, description, and optional button styling.
void showAlert() {
ShowAlert().showAlertDialog(
type: 1,
title: 'Alert Title',
description: 'This is an alert description.',
buttonColor: Colors.blue,
buttonText: 'OK',
buttonTextColor: Colors.white,
backgroundColor: Colors.black,
);
}
copied to clipboard
Show Loading Dialog #
Shows a loading indicator on top of the current screen.
void showLoading(BuildContext context) {
ShowAlert().showLoadingDialog(context);
}
copied to clipboard
Show Selection Dialog #
Displays a dialog with options and custom button actions.
void showSelection() {
ShowAlert().showSelectionDialog(
type: 1,
title: 'Select an Option',
description: 'Choose an option below.',
buttonTextLeft: 'Cancel',
buttonTextRight: 'Confirm',
leftFunction: () {
// Handle left button action
},
rightFunction: () {
// Handle right button action
},
);
}
copied to clipboard
Show Toast Message #
Shows a non-intrusive toast message with a title and description.
void showToast() {
ShowAlert().showToastMessage(
type: 1,
title: 'Toast Title',
description: 'This is a toast message.',
backgroundColor: Colors.green,
);
}
copied to clipboard
Show Custom Dialog #
Displays a custom widget inside a dialog.
void showCustomDialog() {
ShowAlert().showCustomDialog(
MyCustomWidget(), // Replace with your custom widget
);
}
copied to clipboard
Show Custom Alert #
Displays a custom alert with your own widget.
void showCustomAlert() {
ShowAlert().showCustomAlert(
MyCustomAlertWidget(), // Replace with your custom alert widget
);
}
copied to clipboard
Close Alert #
Closes the currently displayed overlay or alert.
void closeAlert() {
ShowAlert().closeAlert();
}
copied to clipboard
Installation #
Add alert_craft to your pubspec.yaml file:
dependencies:
alert_craft: ^1.0.0
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.