ComToastConfig constructor
const
ComToastConfig({
- ComToastType type = ComToastType.normal,
- ComToastPosition position = ComToastPosition.center,
- int duration = 2000,
- Color? backgroundColor,
- Color? textColor,
- double fontSize = 14.0,
- EdgeInsets padding = const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12.0),
- double borderRadius = 12.0,
- double maxWidth = 0.85,
- int animationDuration = 300,
- bool clickThrough = true,
- bool showShadow = true,
- Color shadowColor = const Color(0x1A000000),
- Offset shadowOffset = const Offset(0, 2),
- double shadowBlurRadius = 8.0,
- IconData? icon,
- double iconSize = 20.0,
- Color? iconColor,
- double iconSpacing = 8.0,
- Widget builder(
- BuildContext context
Implementation
const ComToastConfig({
this.type = ComToastType.normal,
this.position = ComToastPosition.center,
this.duration = 2000,
this.backgroundColor,
this.textColor,
this.fontSize = 14.0,
this.padding = const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12.0),
this.borderRadius = 12.0,
this.maxWidth = 0.85,
this.animationDuration = 300,
this.clickThrough = true,
this.showShadow = true,
this.shadowColor = const Color(0x1A000000),
this.shadowOffset = const Offset(0, 2),
this.shadowBlurRadius = 8.0,
this.icon,
this.iconSize = 20.0,
this.iconColor,
this.iconSpacing = 8.0,
this.builder,
}) : assert(duration >= -1,
'Duration must be >= -1 (where -1 means persistent)');