Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,31 @@ class _MyWidgetState extends State<MyWidget> {
}
```

### 8. Using `enableStrictCheck`

The `enableStrictCheck` option can be used to require that **all** checked URIs
must respond successfully for the internet to be considered available. By
default, only one successful response is required.

```dart
final connection = InternetConnection.createInstance(
enableStrictCheck: true,
customCheckOptions: [
InternetCheckOption(uri: Uri.parse('https://example.com')),
InternetCheckOption(uri: Uri.parse('https://example2.com')),
],
);
```

> [!CAUTION]
>
> **Use `enableStrictCheck` only with custom-defined URIs, not with the default
> ones.**
>
> Using it with the default URIs may lead to unreliable results or service
> outages, as all default endpoints must be up and reachable for a positive
> result.

## Built-in and Additional URIs

### Default `Uri`s
Expand Down
4 changes: 4 additions & 0 deletions lib/src/internet_connection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ class InternetConnection {
/// as connected.
///
/// Defaults to `false`.
///
/// **Important:** Use this feature only with custom-defined Uris, not with
/// the default ones, to avoid potential issues with reliability or service
/// outages.
final bool enableStrictCheck;

/// The last known internet connection status result.
Expand Down