File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments