WButtonConfig class

按钮配置类

用于配置 WButton 组件的各种属性 支持链式调用和配置缓存

Constructors

WButtonConfig()

Properties

animationDuration ← Duration
设置动画持续时间
no getter
behavior ← HitTestBehavior
设置点击行为
no getter
containerConfig ← WContainerConfig
设置容器配置
no getter
curve ← Curve
设置动画曲线
no getter
effectType ← WButtonEffectType
设置按钮效果类型
no getter
enabled ← bool
设置是否启用
no getter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scale ← double
设置缩放比例
no getter
tapOpacity ← double
设置点击时的透明度
no getter
textButtonStyle ← WTextConfig
设置文本按钮的默认文本样式
no getter

Methods

buildText({required String text, GestureTapCallback? onTap, WTextConfig? textStyle}) → WButton
用文本构建按钮(以本配置创建 WButton + WText 子组件)
copy() → WButtonConfig
复制一份独立配置
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

clearCache() → void
清空缓存
getCachedConfig(String key, WButtonConfig creator()) → WButtonConfig
获取缓存的配置或创建新配置
opacityEffect({double opacity = 0.7}) → WButtonConfig
快捷方法:创建透明度效果配置
scaleEffect({double scale = 0.95}) → WButtonConfig
快捷方法:创建缩放效果配置
shakeEffect() → WButtonConfig
快捷方法:创建震动效果配置
trimCache() → void
清理超出阈值的缓存