Skip to content

Commit 6fb7ed6

Browse files
authored
docs: added information about enableStrictCheck usage (#93)
1 parent d8cf04d commit 6fb7ed6

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,31 @@ class _MyWidgetState extends State<MyWidget> {
194194
}
195195
```
196196

197+
### 8. Using `enableStrictCheck`
198+
199+
The `enableStrictCheck` option can be used to require that **all** checked URIs
200+
must respond successfully for the internet to be considered available. By
201+
default, only one successful response is required.
202+
203+
```dart
204+
final connection = InternetConnection.createInstance(
205+
enableStrictCheck: true,
206+
customCheckOptions: [
207+
InternetCheckOption(uri: Uri.parse('https://example.com')),
208+
InternetCheckOption(uri: Uri.parse('https://example2.com')),
209+
],
210+
);
211+
```
212+
213+
> [!CAUTION]
214+
>
215+
> **Use `enableStrictCheck` only with custom-defined URIs, not with the default
216+
> ones.**
217+
>
218+
> Using it with the default URIs may lead to unreliable results or service
219+
> outages, as all default endpoints must be up and reachable for a positive
220+
> result.
221+
197222
## Built-in and Additional URIs
198223

199224
### Default `Uri`s

lib/src/internet_connection.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ class InternetConnection {
126126
/// as connected.
127127
///
128128
/// Defaults to `false`.
129+
///
130+
/// **Important:** Use this feature only with custom-defined Uris, not with
131+
/// the default ones, to avoid potential issues with reliability or service
132+
/// outages.
129133
final bool enableStrictCheck;
130134

131135
/// The last known internet connection status result.

0 commit comments

Comments
 (0)