AlertComponentOptions constructor

AlertComponentOptions({
  1. required bool visible,
  2. required String message,
  3. String type = 'success',
  4. int duration = 4000,
  5. VoidCallback? onHide,
  6. Color textColor = Colors.black,
  7. Color? successColor,
  8. Color? dangerColor,
  9. double overlayOpacity = 0.5,
  10. Color overlayColor = Colors.black,
  11. EdgeInsetsGeometry? overlayPadding = const EdgeInsets.all(16),
  12. AlignmentGeometry overlayAlignment = Alignment.center,
  13. bool overlayDismissible = true,
  14. AlertTapCallback? onOverlayTap,
  15. bool contentDismissible = true,
  16. AlertTapCallback? onContentTap,
  17. BoxDecoration? containerDecoration,
  18. EdgeInsetsGeometry? containerPadding = const EdgeInsets.symmetric(horizontal: 24, vertical: 20),
  19. EdgeInsetsGeometry? containerMargin,
  20. Clip? containerClipBehavior,
  21. double? maxWidth = 420,
  22. double? minWidth,
  23. TextStyle? messageStyle,
  24. EdgeInsetsGeometry? messagePadding,
  25. TextAlign messageAlignment = TextAlign.center,
  26. int? messageMaxLines,
  27. double contentSpacing = 12,
  28. CrossAxisAlignment contentAlignment = CrossAxisAlignment.center,
  29. MainAxisSize contentMainAxisSize = MainAxisSize.min,
  30. List<Widget>? actions,
  31. Widget? leading,
  32. Widget? trailing,
  33. AlertMessageBuilder? messageBuilder,
  34. AlertContentBuilder? contentBuilder,
  35. AlertOverlayBuilder? overlayBuilder,
  36. Duration animationDuration = const Duration(milliseconds: 200),
  37. Curve animationCurve = Curves.easeInOut,
})

Implementation

AlertComponentOptions({
  required this.visible,
  required this.message,
  this.type = 'success',
  this.duration = 4000,
  this.onHide,
  this.textColor = Colors.black,
  this.successColor,
  this.dangerColor,
  this.overlayOpacity = 0.5,
  this.overlayColor = Colors.black,
  this.overlayPadding = const EdgeInsets.all(16),
  this.overlayAlignment = Alignment.center,
  this.overlayDismissible = true,
  this.onOverlayTap,
  this.contentDismissible = true,
  this.onContentTap,
  this.containerDecoration,
  this.containerPadding =
      const EdgeInsets.symmetric(horizontal: 24, vertical: 20),
  this.containerMargin,
  this.containerClipBehavior,
  this.maxWidth = 420,
  this.minWidth,
  this.messageStyle,
  this.messagePadding,
  this.messageAlignment = TextAlign.center,
  this.messageMaxLines,
  this.contentSpacing = 12,
  this.contentAlignment = CrossAxisAlignment.center,
  this.contentMainAxisSize = MainAxisSize.min,
  this.actions,
  this.leading,
  this.trailing,
  this.messageBuilder,
  this.contentBuilder,
  this.overlayBuilder,
  this.animationDuration = const Duration(milliseconds: 200),
  this.animationCurve = Curves.easeInOut,
})  : assert(duration >= 0, 'duration must be zero or positive'),
      assert(overlayOpacity >= 0 && overlayOpacity <= 1,
          'overlayOpacity must be between 0 and 1'),
      assert(maxWidth == null || maxWidth > 0,
          'maxWidth must be positive when provided'),
      assert(
          minWidth == null || minWidth >= 0, 'minWidth cannot be negative'),
      assert(
        maxWidth == null || minWidth == null || maxWidth >= minWidth,
        'maxWidth must be greater than or equal to minWidth',
      );