AwesomeDialog constructor

AwesomeDialog({
  1. required BuildContext context,
  2. DialogType dialogType = DialogType.info,
  3. Widget? customHeader,
  4. String? title,
  5. TextStyle? titleTextStyle,
  6. String? desc,
  7. TextStyle? descTextStyle,
  8. Widget? body,
  9. Widget? btnOk,
  10. Widget? btnCancel,
  11. String? btnOkText,
  12. IconData? btnOkIcon,
  13. void btnOkOnPress()?,
  14. Color? btnOkColor,
  15. String? btnCancelText,
  16. IconData? btnCancelIcon,
  17. void btnCancelOnPress()?,
  18. Color? btnCancelColor,
  19. void onDismissCallback(
    1. DismissType type
    )?,
  20. bool isDense = false,
  21. bool dismissOnTouchOutside = true,
  22. bool headerAnimationLoop = true,
  23. AlignmentGeometry alignment = Alignment.center,
  24. AnimType animType = AnimType.scale,
  25. EdgeInsetsGeometry? padding,
  26. bool useRootNavigator = false,
  27. Duration? autoHide,
  28. bool keyboardAware = true,
  29. bool dismissOnBackKeyPress = true,
  30. double? width,
  31. BorderRadiusGeometry? dialogBorderRadius,
  32. BorderRadiusGeometry? buttonsBorderRadius,
  33. bool showCloseIcon = false,
  34. Widget? closeIcon,
  35. Color? dialogBackgroundColor,
  36. BorderSide? borderSide,
  37. TextStyle? buttonsTextStyle,
  38. bool autoDismiss = true,
  39. Color? barrierColor = Colors.black54,
  40. bool enableEnterKey = false,
  41. double bodyHeaderDistance = 15.0,
  42. bool reverseBtnOrder = false,
  43. 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',
      );