playUntil method

Future<LottoResult> playUntil(
  1. FutureOr<LottoDraw?> resolveDraw(), {
  2. Duration minSpinDuration = Duration.zero,
})

等待服务端号码及最短有效转动时间,null 作废,返回本局最终结果。

Implementation

Future<LottoResult> playUntil(FutureOr<LottoDraw?> Function() resolveDraw,
        {Duration minSpinDuration = Duration.zero}) =>
    runPlayUntil(resolveDraw, minSpinDuration,
        (draw) => draw == null ? cancel() : stopWith(draw));