diff --git a/README.md b/README.md index 18e0ccd..52f72c8 100644 --- a/README.md +++ b/README.md @@ -194,6 +194,31 @@ class _MyWidgetState extends State { } ``` +### 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 diff --git a/lib/src/internet_connection.dart b/lib/src/internet_connection.dart index 60deb4a..2b830c1 100644 --- a/lib/src/internet_connection.dart +++ b/lib/src/internet_connection.dart @@ -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.