AwesomeDialog constructor
AwesomeDialog({
- required BuildContext context,
- DialogType dialogType = DialogType.info,
- Widget? customHeader,
- String? title,
- TextStyle? titleTextStyle,
- String? desc,
- TextStyle? descTextStyle,
- Widget? body,
- Widget? btnOk,
- Widget? btnCancel,
- String? btnOkText,
- IconData? btnOkIcon,
- void btnOkOnPress()?,
- Color? btnOkColor,
- String? btnCancelText,
- IconData? btnCancelIcon,
- void btnCancelOnPress()?,
- Color? btnCancelColor,
- void onDismissCallback(
- DismissType type
- bool isDense = false,
- bool dismissOnTouchOutside = true,
- bool headerAnimationLoop = true,
- AlignmentGeometry alignment = Alignment.center,
- AnimType animType = AnimType.scale,
- EdgeInsetsGeometry? padding,
- Duration? autoHide,
- bool keyboardAware = true,
- bool dismissOnBackKeyPress = true,
- double? width,
- BorderRadiusGeometry? dialogBorderRadius,
- BorderRadiusGeometry? buttonsBorderRadius,
- bool showCloseIcon = false,
- Widget? closeIcon,
- Color? dialogBackgroundColor,
- BorderSide? borderSide,
- TextStyle? buttonsTextStyle,
- bool autoDismiss = true,
- Color? barrierColor = Colors.black54,
- bool enableEnterKey = false,
- double bodyHeaderDistance = 15.0,
- bool reverseBtnOrder = false,
- Duration transitionAnimationDuration = const Duration(milliseconds: 300),
Constructor
Implementation
AwesomeDialog({
required this.context,
this.dialogType = DialogType.info,
this.customHeader,
this.title,
this.titleTextStyle,
this.desc,
this.descTextStyle,
this.body,
this.btnOk,
this.btnCancel,
this.btnOkText,
this.btnOkIcon,
this.btnOkOnPress,
this.btnOkColor,
this.btnCancelText,
this.btnCancelIcon,
this.btnCancelOnPress,
this.btnCancelColor,
this.onDismissCallback,
this.isDense = false,
this.dismissOnTouchOutside = true,
this.headerAnimationLoop = true,
this.alignment = Alignment.center,
this.animType = AnimType.scale,
this.padding,
this.useRootNavigator = false,
this.autoHide,
this.keyboardAware = true,
this.dismissOnBackKeyPress = true,
this.width,
this.dialogBorderRadius,
this.buttonsBorderRadius,
this.showCloseIcon = false,
this.closeIcon,
this.dialogBackgroundColor,
this.borderSide,
this.buttonsTextStyle,
this.autoDismiss = true,
this.barrierColor = Colors.black54,
this.enableEnterKey = false,
this.bodyHeaderDistance = 15.0,
this.reverseBtnOrder = false,
this.transitionAnimationDuration = const Duration(milliseconds: 300),
}) : assert(
autoDismiss || onDismissCallback != null,
'If autoDismiss is false, you must provide an onDismissCallback to pop the dialog',
);