ComToastConfig constructor

const ComToastConfig({
  1. ComToastType? type,
  2. ComToastPresentation? presentation,
  3. ComToastPosition? position,
  4. Duration? duration,
  5. Color? backgroundColor,
  6. Color? textColor,
  7. double? fontSize,
  8. EdgeInsets? padding,
  9. double? borderRadius,
  10. double? maxWidth,
  11. int? animationDuration,
  12. bool? clickThrough,
  13. bool? showShadow,
  14. Color? shadowColor,
  15. Offset? shadowOffset,
  16. double? shadowBlurRadius,
  17. IconData? icon,
  18. Widget? iconWidget,
  19. double? iconSize,
  20. Color? iconColor,
  21. double? iconSpacing,
  22. Widget builder(
    1. BuildContext context
    )?,
  23. VoidCallback? onTap,
  24. bool? showCloseButton,
  25. double? topMargin,
  26. double? bottomMargin,
})

Implementation

const ComToastConfig({
  ComToastType? type,
  ComToastPresentation? presentation,
  ComToastPosition? position,
  Duration? duration,
  this.backgroundColor,
  this.textColor,
  double? fontSize,
  EdgeInsets? padding,
  double? borderRadius,
  double? maxWidth,
  int? animationDuration,
  bool? clickThrough,
  bool? showShadow,
  Color? shadowColor,
  Offset? shadowOffset,
  double? shadowBlurRadius,
  this.icon,
  this.iconWidget,
  double? iconSize,
  this.iconColor,
  double? iconSpacing,
  this.builder,
  this.onTap,
  bool? showCloseButton,
  double? topMargin,
  double? bottomMargin,
})  : type = type ?? ComToastType.normal,
      presentation = presentation ?? ComToastPresentation.toast,
      position = position ?? ComToastPosition.center,
      duration = duration ?? const Duration(milliseconds: 1500),
      fontSize = fontSize ?? 14.0,
      padding = padding ??
          const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12.0),
      borderRadius = borderRadius ?? 12.0,
      maxWidth = maxWidth ?? 0.85,
      animationDuration = animationDuration ?? 300,
      clickThrough = clickThrough ?? true,
      showShadow = showShadow ?? true,
      shadowColor = shadowColor ?? const Color(0x1A000000),
      shadowOffset = shadowOffset ?? const Offset(0, 4),
      shadowBlurRadius = shadowBlurRadius ?? 8.0,
      iconSize = iconSize ?? 20.0,
      iconSpacing = iconSpacing ?? 8.0,
      showCloseButton = showCloseButton ?? false,
      topMargin = topMargin ?? 12.0,
      bottomMargin = bottomMargin ?? 100.0,
      _specifiedFields = (type == null ? 0 : _typeField) |
          (presentation == null ? 0 : _presentationField) |
          (position == null ? 0 : _positionField) |
          (duration == null ? 0 : _durationField) |
          (fontSize == null ? 0 : _fontSizeField) |
          (padding == null ? 0 : _paddingField) |
          (borderRadius == null ? 0 : _borderRadiusField) |
          (maxWidth == null ? 0 : _maxWidthField) |
          (animationDuration == null ? 0 : _animationDurationField) |
          (clickThrough == null ? 0 : _clickThroughField) |
          (showShadow == null ? 0 : _showShadowField) |
          (shadowColor == null ? 0 : _shadowColorField) |
          (shadowOffset == null ? 0 : _shadowOffsetField) |
          (shadowBlurRadius == null ? 0 : _shadowBlurRadiusField) |
          (iconSize == null ? 0 : _iconSizeField) |
          (iconSpacing == null ? 0 : _iconSpacingField) |
          (showCloseButton == null ? 0 : _showCloseButtonField) |
          (topMargin == null ? 0 : _topMarginField) |
          (bottomMargin == null ? 0 : _bottomMarginField);