LuckyMotionOptions class final
动画配置;默认按有效时间推进并使用单调停止求解。
例如 const LuckyMotionOptions(speed: 10);非正时长由 motion.configure 断言,
毫秒访问器始终至少返回 1,避免运行期除零。
- Annotations
Constructors
- LuckyMotionOptions({double speed = kLuckyDefaultSpeed, Duration accelerationTime = kLuckyDefaultAccelerationTime, Duration decelerationTime = kLuckyDefaultDecelerationTime, LuckyEasing accelerationEasing = LuckyEasings.quad, LuckyEasing decelerationEasing = LuckyEasings.quad, LuckyTimebase timebase = LuckyTimebase.time, LuckyStopSolver stopSolver = const MonotonicStopSolver(), Duration maxFrameDelta = kLuckyDefaultMaxFrameDelta, double idleSpinSpeed = kLuckyDefaultIdleSpinSpeed})
-
创建不可变配置;时长应为正,maxFrameDelta 应非负。
const
Properties
- accelerationEasing → LuckyEasing
-
加速缓动。
final
- accelerationMs → double
-
至少一毫秒的加速时长。
no setter
- accelerationTime → Duration
-
加速时长,应为正。
final
- decelerationEasing → LuckyEasing
-
减速缓动。
final
- decelerationMs → double
-
至少一毫秒的减速时长。
no setter
- decelerationTime → Duration
-
减速时长,应为正。
final
- hashCode → int
-
与值相等性一致的哈希值。
no setteroverride
- idleSpinSpeed → double
-
待机慢转每参考帧的速度。
final
- maxFrameDelta → Duration
-
有效时间轴单帧最大推进量。
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- speed → double
-
匀速阶段每参考帧的速度。
final
- stopSolver → LuckyStopSolver
-
停止求解策略。
final
- timebase → LuckyTimebase
-
位移时间基准。
final
Methods
-
copyWith(
{double? speed, Duration? accelerationTime, Duration? decelerationTime, LuckyEasing? accelerationEasing, LuckyEasing? decelerationEasing, LuckyTimebase? timebase, LuckyStopSolver? stopSolver, Duration? maxFrameDelta, double? idleSpinSpeed}) → LuckyMotionOptions -
返回只替换非 null 参数的副本;例如
options.copyWith(speed: 30)。 -
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 -
按全部字段比较配置值。
override