changeAlertType method
void
changeAlertType({
- required StylishDialogType alertType,
- Widget? title,
- Widget? content,
- @Deprecated('Use `confirmButton` instead. will be removed soon') String? confirmText,
- @Deprecated('Use `cancelButton` instead. will be removed soon') String? cancelText,
- @Deprecated('Use `confirmButton` instead. will be removed soon') VoidCallback? confirmPressEvent,
- @Deprecated('Use `cancelButton` instead. will be removed soon') VoidCallback? cancelPressEvent,
- Widget? confirmButton,
- Widget? cancelButton,
Call changeAlertType function to change the alert type of the current dialog
StylishDialog dialog = StylishDialog(
context: context,
alertType: StylishDialogType.PROGRESS,
...
);
...
dialog.changeAlertType(
alertType: StylishDialogType.WARNING,
...
);
Implementation
void changeAlertType({
required StylishDialogType alertType,
///title widget of the dialog
Widget? title,
///content widget of the dialog
Widget? content,
@Deprecated('Use `confirmButton` instead. will be removed soon')
String? confirmText,
@Deprecated('Use `cancelButton` instead. will be removed soon')
String? cancelText,
@Deprecated('Use `confirmButton` instead. will be removed soon')
VoidCallback? confirmPressEvent,
@Deprecated('Use `cancelButton` instead. will be removed soon')
VoidCallback? cancelPressEvent,
///Use this to add confirm button widget.
///To assign press event on non-clickable widgets like
///```dart
/// Containter(), Text() etc.
///```
///Wrap you widget with
///```dart
///GestureDetector() or InkWell()
///```
Widget? confirmButton,
///Use this to add cancel button widget.
///To assign press event on non-clickable widgets like
///```dart
/// Containter(), Text() etc.
///```
///Wrap you widget with
///```dart
///GestureDetector(
/// onTap: (){
///
/// },
///
/// child: ...
///
///),
/// //or
///
///InkWell(
/// onTap: (){
///
/// },
///
/// child: ...
///
///),
///```
Widget? cancelButton,
}) {
_stateSetter(() {
this.title = title;
this.content = content;
this.confirmText = confirmText;
this.cancelText = cancelText;
this.confirmPressEvent = confirmPressEvent;
this.cancelPressEvent = cancelPressEvent;
this.confirmButton = confirmButton;
this.cancelButton = cancelButton;
_changeAlert = alertType;
controller?.setValue = DialogStatus.Changed;
_buildDialogUI();
});
}