StealthInternetChecker constructor

StealthInternetChecker({
  1. String? heartbeatUrl,
  2. Duration checkInterval = const Duration(seconds: 5),
  3. Duration timeout = const Duration(seconds: 3),
  4. List<String> dnsTargets = const ['8.8.8.8', '1.1.1.1'],
  5. int dnsPort = 443,
})

Implementation

StealthInternetChecker({
  this.heartbeatUrl,
  this.checkInterval = const Duration(seconds: 5),
  this.timeout = const Duration(seconds: 3),
  this.dnsTargets = const ['8.8.8.8', '1.1.1.1'],
  this.dnsPort = 443,
}) {
  _dio = Dio(BaseOptions(
    connectTimeout: timeout,
    receiveTimeout: timeout,
    validateStatus: (status) => status != null && status < 500,
  ));

  _controller = StreamController<bool>.broadcast(
    onListen: _start,
    onCancel: _stop,
  );
}