ComToastConfig class
Constructors
- ComToastConfig.new({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)?})
-
const
Properties
- animationDuration → int
-
Toast 动画时长(毫秒)
final
- backgroundColor → Color?
-
Toast 背景颜色(null表示使用主题适配)
final
- borderRadius → double
-
Toast 圆角
final
- builder → Widget Function(BuildContext context)?
-
Toast 自定义内容构建器
final
- clickThrough → bool
-
Toast 是否可点击穿透
final
- duration → int
-
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
- 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
- type → ComToastType
-
Toast 类型
final
Methods
-
copyWith(
{ComToastType? type, ComToastPosition? position, int? 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, double? iconSize, Color? iconColor, double? iconSpacing, Widget builder(BuildContext context)?}) → 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 - 获取默认配置