AlertDialog constructor Null safety

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. String? semanticLabel,
  21. EdgeInsets insetPadding = _defaultInsetPadding,
  22. Clip clipBehavior = Clip.none,
  23. ShapeBorder? shape,
  24. AlignmentGeometry? alignment,
  25. 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.semanticLabel,
  this.insetPadding = _defaultInsetPadding,
  this.clipBehavior = Clip.none,
  this.shape,
  this.alignment,
  this.scrollable = false,
}) : assert(clipBehavior != null);