AlertDialog constructor

const AlertDialog(
  1. {Key? key,
  2. Widget? icon,
  3. EdgeInsetsGeometry? iconPadding,
  4. Color? iconColor,
  5. Widget? title,
  6. EdgeInsetsGeometry? titlePadding,
  7. TextStyle? titleTextStyle,
  8. Widget? content,
  9. EdgeInsetsGeometry? contentPadding,
  10. TextStyle? contentTextStyle,
  11. List<Widget>? actions,
  12. EdgeInsetsGeometry? actionsPadding,
  13. MainAxisAlignment? actionsAlignment,
  14. OverflowBarAlignment? actionsOverflowAlignment,
  15. VerticalDirection? actionsOverflowDirection,
  16. double? actionsOverflowButtonSpacing,
  17. EdgeInsetsGeometry? buttonPadding,
  18. Color? backgroundColor,
  19. double? elevation,
  20. Color? shadowColor,
  21. Color? surfaceTintColor,
  22. String? semanticLabel,
  23. EdgeInsets? insetPadding,
  24. Clip clipBehavior = Clip.none,
  25. ShapeBorder? shape,
  26. AlignmentGeometry? alignment,
  27. bool scrollable = false}
)

Creates an alert dialog.

Typically used in conjunction with showDialog.

The titlePadding and contentPadding default to null, which implies a default that depends on the values of the other properties. See the documentation of titlePadding and contentPadding for details.

Implementation

const AlertDialog({
  super.key,
  this.icon,
  this.iconPadding,
  this.iconColor,
  this.title,
  this.titlePadding,
  this.titleTextStyle,
  this.content,
  this.contentPadding,
  this.contentTextStyle,
  this.actions,
  this.actionsPadding,
  this.actionsAlignment,
  this.actionsOverflowAlignment,
  this.actionsOverflowDirection,
  this.actionsOverflowButtonSpacing,
  this.buttonPadding,
  this.backgroundColor,
  this.elevation,
  this.shadowColor,
  this.surfaceTintColor,
  this.semanticLabel,
  this.insetPadding,
  this.clipBehavior = Clip.none,
  this.shape,
  this.alignment,
  this.scrollable = false,
});