cancelWith method

  1. @protected
bool cancelWith(
  1. void apply(
    1. bool reportsResult
    )
)

取消骨架:当前阶段不可取消返回 false,否则调用 apply 并返回 true。

apply 的参数表示是否产生作废结果:待机慢转的取消不产生结果。

Implementation

@protected
bool cancelWith(void Function(bool reportsResult) apply) {
  if (!phase.canCancel) return false;
  apply(phase != LuckyPhase.idleSpinning);
  return true;
}