networkConfirmationProbeCount property

int get networkConfirmationProbeCount

Number of sequential confirmation probes that must all fail before the app flips to offline (confirm-before-flip).

Can be set via:

  • Code: AppConfigBase.networkConfirmationProbeCountDefault = 1
  • Build flag: --dart-define dreamic_network_confirmation_probe_count=1
  • Firebase Remote Config: dreamic_network_confirmation_probe_count

Default: 1 (bounds 1-5). The env/dart-define path is clamped to bounds (NET-022).

Implementation

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