ComToastConfig class

Constructors

ComToastConfig({ComToastType type = ComToastType.normal, ComToastPosition position = ComToastPosition.center, Duration duration = const Duration(milliseconds: 1500), 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, 4), double shadowBlurRadius = 8.0, IconData? icon, Widget? iconWidget, double iconSize = 20.0, Color? iconColor, double iconSpacing = 8.0, Widget builder(BuildContext context)?, double topMargin = 50.0, double bottomMargin = 100.0})
const

Properties

animationDuration → int
Toast 动画时长(毫秒)
final
backgroundColor → Color?
Toast 背景颜色(null表示使用主题适配)
final
borderRadius → double
Toast 圆角
final
bottomMargin → double
底部位置偏移
final
builder → Widget Function(BuildContext context)?
Toast 自定义内容构建器
final
clickThrough → bool
Toast 是否可点击穿透
final
duration → Duration
Toast 显示时长
final
fontSize → double
Toast 文字大小
final
hashCode → int
The hash code for this object.
no setterinherited
icon → IconData?
Toast 图标
final
iconColor → Color?
Toast 图标颜色
final
iconSize → double
Toast 图标大小
final
iconSpacing → double
Toast 图标与文字间距
final
iconWidget → Widget?
Toast 自定义图标组件
final
maxWidth → double
Toast 最大宽度
final
padding → EdgeInsets
Toast 内边距
final
position → ComToastPosition
Toast 显示位置
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shadowBlurRadius → double
Toast 阴影模糊半径
final
shadowColor → Color
Toast 阴影颜色
final
shadowOffset → Offset
Toast 阴影偏移
final
showShadow → bool
Toast 是否显示阴影
final
textColor → Color?
Toast 文字颜色(null表示使用主题适配)
final
topMargin → double
顶部位置偏移
final
type → ComToastType
Toast 类型
final

Methods

copyWith({ComToastType? type, ComToastPosition? position, Duration? duration, Color? backgroundColor, Color? textColor, double? fontSize, EdgeInsets? padding, double? borderRadius, double? maxWidth, int? animationDuration, bool? clickThrough, bool? showShadow, Color? shadowColor, Offset? shadowOffset, double? shadowBlurRadius, IconData? icon, Widget? iconWidget, double? iconSize, Color? iconColor, double? iconSpacing, Widget builder(BuildContext context)?, double? topMargin, double? bottomMargin}) → ComToastConfig
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

getDefaultConfig(ComToastType type) → ComToastConfig
获取默认配置