NiceDialog constructor

NiceDialog({
  1. NiceDialogType? type,
  2. Color? typeInfoColor,
  3. Color? typeWarningColor,
  4. Color? typeErrorColor,
  5. Color? typeMultipleOptionsColor,
  6. Color? backgroundColor,
  7. double? elevation,
  8. ShapeBorder? shape,
  9. Widget? header,
  10. Color? headerColor,
  11. Widget? headerIcon,
  12. IconData? headerIconData,
  13. double? headerIconSize,
  14. Color? headerIconColor,
  15. double? headerPadding,
  16. double? borderRadius,
  17. Widget? title,
  18. String? titleText,
  19. Color? titleColor,
  20. Widget? content,
  21. String? message,
  22. Color? messageColor,
  23. Widget? btnOk,
  24. String? btnOkText,
  25. Color? btnOkColor,
  26. VoidCallback? btnOkAction,
  27. Widget? btnCancel,
  28. String? btnCancelText,
  29. Color? btnCancelColor,
  30. VoidCallback? btnCancelAction,
  31. Widget? btnNeutral,
  32. String? btnNeutralText,
  33. Color? btnNeutralColor,
  34. VoidCallback? btnNeutralAction,
  35. double? textScaleFactor,
})

Implementation

NiceDialog({
  NiceDialogType? type,
  Color? typeInfoColor,
  Color? typeWarningColor,
  Color? typeErrorColor,
  Color? typeMultipleOptionsColor,
  this.backgroundColor,
  this.elevation,
  ShapeBorder? shape,
  this.header,
  this.headerColor,
  this.headerIcon,
  this.headerIconData,
  double? headerIconSize,
  Color? headerIconColor,
  double? headerPadding,
  double? borderRadius,
  this.title,
  this.titleText,
  this.titleColor,
  this.content,
  this.message,
  this.messageColor,
  this.btnOk,
  this.btnOkText,
  this.btnOkColor,
  this.btnOkAction,
  this.btnCancel,
  this.btnCancelText,
  this.btnCancelColor,
  this.btnCancelAction,
  this.btnNeutral,
  this.btnNeutralText,
  this.btnNeutralColor,
  this.btnNeutralAction,
  this.textScaleFactor,
})  : type = type ?? NiceDialogType.NONE,
      typeInfoColor = typeInfoColor ?? Colors.blue,
      typeWarningColor = typeWarningColor ?? Colors.orange,
      typeErrorColor = typeErrorColor ?? const Color(0xFFC62828),
      typeMultipleOptionsColor = typeMultipleOptionsColor ?? Colors.green,
      headerIconSize = headerIconSize ?? 48,
      headerIconColor = headerIconColor ?? Colors.white,
      headerPadding = headerPadding ?? 8,
      borderRadius = borderRadius ?? 16,
      shape = shape ??
          RoundedRectangleBorder(
              borderRadius:
                  BorderRadius.all(Radius.circular(borderRadius ?? 16))) {
  headerIconData ??= (getDialogTypeIconData() ?? Icons.info);
  headerColor ??= (getDialogTypeColor() ?? Colors.blue);
  headerIcon ??= Icon(
    headerIconData,
    color: this.headerIconColor,
    size: this.headerIconSize,
  );
}