ToastStyle constructor

const ToastStyle({
  1. double? fontSize,
  2. String? fontAsset,
  3. Color? backgroundColor,
  4. Color? textColor,
  5. double? borderRadius,
  6. String? iconAsset,
  7. double? iconSize,
  8. Color? iconColor,
  9. ToastIconPosition? iconPosition,
  10. double? iconSpacing,
  11. dynamic webBgColor = "linear-gradient(to right, #00b09b, #96c93d)",
})

构造函数

创建一个新的ToastStyle实例,所有参数都是可选的 使用const构造函数确保编译时优化和不可变性

参数说明: fontSize - 字体大小 fontAsset - 自定义字体资源路径 backgroundColor - 背景颜色 textColor - 文本颜色 borderRadius - 圆角大小 iconAsset - 图标资源路径 iconSize - 图标大小 iconColor - 图标颜色 iconPosition - 图标位置 iconSpacing - 图标与文字间距 webBgColor - Web平台背景颜色

Implementation

const ToastStyle({
  this.fontSize,
  this.fontAsset,
  this.backgroundColor,
  this.textColor,
  this.borderRadius,
  this.iconAsset,
  this.iconSize,
  this.iconColor,
  this.iconPosition,
  this.iconSpacing,
  this.webBgColor = "linear-gradient(to right, #00b09b, #96c93d)",
});