Skip to content

基于自定义规则的番剧采集APP,支持流媒体在线观看,支持弹幕,支持实时超分辨率。

601 B
Raw Blame
import 'dart:async';

const startupUpdateCheckDelay = Duration(milliseconds: 500);

/// Runs the startup update check independently from the page that scheduled it.
///
/// Startup pages are normally disposed as soon as they navigate to the app
/// shell, so this work must not depend on their [State.mounted] value.
Future<void> runStartupUpdateCheck({
  required bool Function() isEnabled,
  required Future<void> Function() checkForUpdate,
  Duration delay = startupUpdateCheckDelay,
}) async {
  await Future<void>.delayed(delay);
  if (!isEnabled()) {
    return;
  }
  await checkForUpdate();
}