ComToastConfig class
Constructors
- ComToastConfig({ComToastType? type, ComToastPresentation? presentation, 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)?, VoidCallback? onTap, bool? showCloseButton, double? topMargin, double? bottomMargin})
-
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
- onTap → VoidCallback?
-
点击回调
final
- padding → EdgeInsets
-
Toast 内边距
final
- position → ComToastPosition
-
Toast 显示位置
final
- presentation → ComToastPresentation
-
展示语义
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
- showCloseButton → bool
-
是否显示关闭按钮
final
- showShadow → bool
-
Toast 是否显示阴影
final
- textColor → Color?
-
Toast 文字颜色(null表示使用主题适配)
final
- topMargin → double
-
顶部位置偏移
final
- type → ComToastType
-
Toast 类型
final
Methods
-
applyTo(
ComToastConfig base, {bool preserveBaseType = true}) → ComToastConfig -
copyWith(
{ComToastType? type, ComToastPresentation? presentation, 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)?, VoidCallback? onTap, bool? showCloseButton, 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
-
validate(
) → void
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
getDefaultBannerConfig(
ComToastType type) → ComToastConfig -
getDefaultConfig(
ComToastType type) → ComToastConfig - 获取默认配置
Constants
- defaults → const ComToastConfig