networkPollIntervalOfflineMill property

int get networkPollIntervalOfflineMill

Fast poll cadence (ms) for the reachability probe while the app is offline (adaptive re-check for near-immediate recovery detection).

Can be set via:

  • Code: AppConfigBase.networkPollIntervalOfflineMillDefault = 2000
  • Build flag: --dart-define dreamic_network_poll_interval_offline_mill=2000
  • Firebase Remote Config: dreamic_network_poll_interval_offline_mill

Default: 2000 (bounds 500-30000). The env/dart-define path is clamped to bounds (NET-022).

Implementation

static int get networkPollIntervalOfflineMill {
  final bounds = configBounds['dreamic_network_poll_interval_offline_mill']!;
  const envValue = int.fromEnvironment(
    'dreamic_network_poll_interval_offline_mill',
    defaultValue: -1,
  );
  if (envValue != -1) {
    return envValue.clamp(bounds.min, bounds.max);
  } else {
    final remoteValue =
        g<RemoteConfigRepoInt>().getInt('dreamic_network_poll_interval_offline_mill');
    if (remoteValue > 0) {
      return remoteValue.clamp(bounds.min, bounds.max);
    } else {
      return defaultRemoteConfig['dreamic_network_poll_interval_offline_mill'] as int;
    }
  }
}