11# Internet Connection Checker Plus
22
3- A Flutter package to check your internet connection with subsecond response
4- times, even on mobile networks!
3+ The internet connectivity checker that actually works! 🌐
4+
5+ Because sometimes ` ConnectivityResult.wifi ` means you're connected to a router that's as useful as a chocolate teapot! 🍫🫖
6+
7+ _ Like trust issues, but for your network connection. We ping, therefore we know._ ✨
58
69[ ![ pub package] [ package_svg ]] [ package ] [ ![ GitHub] [ license_svg ]] ( LICENSE )
710
@@ -10,26 +13,35 @@ times, even on mobile networks!
1013
1114<hr />
1215
16+ ** ✅ Check real internet connectivity, not just Wi-Fi connection**
17+ ** 🚀 Subsecond response times** _ (even on mobile networks!)_
18+ ** 📡 Listen to connectivity changes in real-time**
19+ ** ⚙️ Fully customizable endpoints and success criteria**
20+ ** 📱 Cross-platform support** _ (Android, iOS, macOS, Linux, Windows, Web)_
21+
1322This library provides functionality to monitor and verify internet connectivity
1423by checking reachability to various URIs. It relies on the ` connectivity_plus `
1524package for listening to connectivity changes and the ` http ` package for making
1625network requests.
1726
18- ## Features
27+ ## 💝 Support the Project
28+
29+ If this package saved you from the eternal torment of "No Internet Connection" errors, consider buying me a coffee! ☕
1930
20- - ✅ Check internet connectivity status
21- - ✅ Listen to internet connectivity changes
22- - ✅ Customizable endpoints and success criteria
23- - ✅ Customizable connectivity check logic
31+ <a href =" https://coff.ee/outdatedguy " target =" _blank " ><img src =" https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png " alt =" Buy Me A Coffee " style =" height : 60px !important ;width : 217px !important ;" ></a >
2432
25- ## Supported Platforms
33+ _ Every coffee helps fuel late-night coding sessions and the occasional existential crisis about whether ` null ` is a friend or foe._ 🤔☕
34+
35+ ## 🌍 Platform Support
2636
2737| Features | Android | iOS | macOS | Linux | Windows | Web |
2838| :----------------: | :-----: | :-: | :---: | :---: | :-----: | :-: |
2939| Check Connectivity | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
3040| Listen to Changes | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
3141
32- ## Permissions
42+ _ Full support across all platforms - because connectivity anxiety is universal!_ 🚀
43+
44+ ## 📋 Permissions
3345
3446### Android
3547
@@ -50,9 +62,9 @@ Add the following to your macOS `.entitlements` files:
5062
5163For more information, see the [ Flutter Networking Documentation] .
5264
53- ## Usage
65+ ## 🚀 Quick Start
5466
55- ### Checking for internet connectivity (one-time)
67+ ### Basic connectivity check (one-time)
5668
5769The simplest way to check if you have internet access:
5870
@@ -65,7 +77,7 @@ if (isConnected) {
6577}
6678```
6779
68- ### Listening to internet connectivity changes
80+ ### Listening to connectivity changes
6981
7082The ` InternetConnection ` class exposes a stream of ` InternetStatus ` updates,
7183allowing you to react to changes in connectivity:
@@ -82,18 +94,9 @@ final subscription = InternetConnection().onStatusChange.listen(
8294);
8395```
8496
85- > [ !NOTE]
86- >
87- > Don't forget to cancel the subscription when it is no longer needed. This will
88- > prevent memory leaks and free up resources:
89- >
90- > ``` dart
91- > @override
92- > void dispose() {
93- > subscription.cancel();
94- > super.dispose();
95- > }
96- > ```
97+ _ Don't forget to cancel the subscription to prevent memory leaks! Your phone's RAM will thank you._ 🧹
98+
99+ ## 🎯 Advanced Features
97100
98101### Using custom endpoints (URIs)
99102
@@ -108,10 +111,7 @@ final connection = InternetConnection.createInstance(
108111final isConnected = await connection.hasInternetAccess;
109112```
110113
111- > [ !IMPORTANT]
112- >
113- > - Make sure the endpoints have no caching enabled.
114- > - On ` web ` platform, make sure the endpoints are not CORS blocked.
114+ _ Pro tip: Make sure your endpoints have no caching and aren't CORS blocked on web. We learned this the hard way._ 🌐
115115
116116### Using custom success criteria
117117
@@ -135,6 +135,8 @@ final connection = InternetConnection.createInstance(
135135final isConnected = await connection.hasInternetAccess;
136136```
137137
138+ _ Nice status codes! Because sometimes 200 OK is too mainstream for your vibe._ 😎
139+
138140### Using a custom connectivity check method
139141
140142For advanced use cases, you can completely customize how connectivity checks are performed by providing your own connectivity checker:
@@ -147,7 +149,11 @@ final connection = InternetConnection.createInstance(
147149 final dio = Dio();
148150 final response = await dio.head(
149151 option.uri,
150- options: Options(headers: option.headers, receiveTimeout: option.timeout, validateStatus: (_) => true),
152+ options: Options(
153+ headers: option.headers,
154+ receiveTimeout: option.timeout,
155+ validateStatus: (_) => true
156+ ),
151157 );
152158
153159 return InternetCheckResult(
@@ -163,17 +169,17 @@ final connection = InternetConnection.createInstance(
163169
164170This customization gives you full control over the connectivity detection process, allowing you to:
165171
166- - Implement platform-specific network detection
167- - Use alternate connectivity checking strategies
168- - Implement custom fallback mechanisms
169- - Add detailed logging or metrics for connectivity checks
170- - Integrate with other network monitoring tools
172+ - 🔧 Implement platform-specific network detection
173+ - 🔄 Use alternate connectivity checking strategies
174+ - 🛡️ Implement custom fallback mechanisms
175+ - 📊 Add detailed logging or metrics for connectivity checks
176+ - 🔌 Integrate with other network monitoring tools
171177
172- ### Pause and Resume on App Lifecycle Changes
178+ ### Pause and resume on app lifecycle changes
173179
174- For situation where you want to pause any network requests when the app goes
180+ For situations where you want to pause any network requests when the app goes
175181into the background and resume them when the app comes back into the foreground
176- (see [ issue #27 ] ):
182+ _ (because battery life matters!) _ (see [ issue #27 ] ):
177183
178184``` dart
179185class MyWidget extends StatefulWidget {
@@ -214,7 +220,7 @@ class _MyWidgetState extends State<MyWidget> {
214220}
215221```
216222
217- ### 8. Using ` enableStrictCheck `
223+ ### Using ` enableStrictCheck `
218224
219225The ` enableStrictCheck ` option can be used to require that ** all** checked URIs
220226must respond successfully for the internet to be considered available. By
@@ -232,18 +238,17 @@ final connection = InternetConnection.createInstance(
232238
233239> [ !CAUTION]
234240>
235- > ** Use ` enableStrictCheck ` only with custom-defined URIs, not with the default
236- > ones.**
241+ > ** Use ` enableStrictCheck ` only with custom-defined URIs, not with the default ones.**
237242>
238- > Using it with the default URIs may lead to unreliable results or service
239- > outages, as all default endpoints must be up and reachable for a positive
240- > result.
243+ > 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.
244+
245+ _ Strict mode: For the perfectionists who need ALL the endpoints to respond. We won't judge your trust issues. _ 💯
241246
242- ## Built-in and Additional URIs
247+ ## 📡 Built-in and Additional URIs
243248
244249### Default URIs
245250
246- The following endpoints are checked by default:
251+ The following endpoints are checked by default _ (carefully selected for speed and reliability!) _ :
247252
248253| URI | Description |
249254| :------------------------------------------- | :--------------------------------------------------------- |
@@ -254,22 +259,119 @@ The following endpoints are checked by default:
254259
255260### More Tested URIs
256261
257- The following URIs are tested and work well with the package:
262+ The following URIs are tested and work well with the package _ (community approved!) _ :
258263
259- | URI | Description |
260- | :----------------------------------------- | :--------------------------------------- |
261- | https://ipapi.co/ip | CORS enabled, no-cache |
262- | https://api.adviceslip.com/advice | CORS enabled, no-cache |
263- | https://api.bitbucket.org/2.0/repositories | CORS enabled, no-cache |
264- | https://api.thecatapi.com/v1/images/search | CORS enabled, no-cache |
265- | https://randomuser.me/api/?inc=gender | CORS enabled, no-cache |
266- | https://dog.ceo/api/breed/husky/list | CORS enabled, no-cache |
267- | https://lenta.ru | Russia supported, CORS enabled, no-cache |
268- | https://www.gazeta.ru | Russia supported, CORS enabled, no-cache |
264+ | URI | Description |
265+ | :----------------------------------------- | :---------------------------------------------- |
266+ | https://cloudflare.com/cdn-cgi/trace | Response time < ` 100ms ` , CORS enabled, no-cache |
267+ | https://ipapi.co/ip | CORS enabled, no-cache |
268+ | https://api.adviceslip.com/advice | CORS enabled, no-cache |
269+ | https://api.bitbucket.org/2.0/repositories | CORS enabled, no-cache |
270+ | https://api.thecatapi.com/v1/images/search | CORS enabled, no-cache |
271+ | https://randomuser.me/api/?inc=gender | CORS enabled, no-cache |
272+ | https://dog.ceo/api/breed/husky/list | CORS enabled, no-cache |
273+ | https://lenta.ru | Russia supported, CORS enabled, no-cache |
274+ | https://www.gazeta.ru | Russia supported, CORS enabled, no-cache |
275+
276+ _ Feel free to use your own trusted endpoints! We don't judge your API choices._ 🎯
269277
270278## If you liked the package, then please give it a [ Like 👍🏼] [ package ] and [ Star ⭐] [ repository ]
271279
272- ## Credits
280+ _ Your support keeps this project alive and helps us add more features!_ ✨
281+
282+ ## 🤝 Contributing
283+
284+ Found a bug? Have a feature request? Want to make the internet more reliable for everyone?
285+
286+ 1 . [ Check existing issues] [ issues ]
287+ 2 . [ Report bugs] [ issues_report_bug ]
288+ 3 . [ Request features] [ issues_request_feature ]
289+ 4 . [ Submit PRs] [ pull_requests ]
290+
291+ _ All contributions welcome! Even if it's just fixing our terrible puns in the docs._ 😅
292+
293+ ## 📜 License
294+
295+ BSD 3-Clause License - see [ LICENSE] ( LICENSE ) file for details.
296+
297+ _ TL;DR: Use it, modify it, share it, just don't blame us if your app becomes too reliable._ 😎
298+
299+ ## 🎁 Easter Egg Hunt
300+
301+ _ For the curious developers who actually read READMEs to the end, here's a secret:_ 🕵️
302+
303+ <details >
304+ <summary >🤖 Click to reveal the truth about this README</summary >
305+
306+ ```
307+ 01010100 01101000 01101001 01110011 00100000 01010010 01000101 01000001
308+ 01000100 01001101 01000101 00100000 01110111 01100001 01110011 00100000
309+ 01100011 01110010 01100001 01100110 01110100 01100101 01100100 00100000
310+ 01110111 01101001 01110100 01101000 00100000 01101100 01101111 01110110
311+ 01100101 00100000 01100010 01111001 00100000 01100001 01101110 00100000
312+ 01000001 01001001 00100000 01110100 01101000 01100001 01110100 00100000
313+ 01101000 01100001 01110011 00100000 01110011 01110000 01100101 01101110
314+ 01110100 00100000 01110100 01101111 01101111 00100000 01101101 01110101
315+ 01100011 01101000 00100000 01110100 01101001 01101101 01100101 00100000
316+ 01110010 01100101 01100001 01100100 01101001 01101110 01100111 00100000
317+ 01110101 01110011 01100101 01110010 00100000 01110010 01100101 01110110
318+ 01101001 01100101 01110111 01110011 00100000 01100001 01101110 01100100
319+ 00100000 01100100 01101111 01100011 01110011 00101110 00100000 11110000
320+ 10011111 10100100 10010110 00001010 00001010 01001001 01100110 00100000
321+ 01111001 01101111 01110101 00100111 01110010 01100101 00100000 01110010
322+ 01100101 01100001 01100100 01101001 01101110 01100111 00100000 01110100
323+ 01101000 01101001 01110011 00101100 00100000 01111001 01101111 01110101
324+ 00100111 01110010 01100101 00100000 01100101 01101001 01110100 01101000
325+ 01100101 01110010 00100000 01100001 00100000 01100100 01100101 01100100
326+ 01101001 01100011 01100001 01110100 01100101 01100100 00100000 01100100
327+ 01100101 01110110 01100101 01101100 01101111 01110000 01100101 01110010
328+ 00100000 01101111 01110010 00100000 01110010 01100101 01100001 01101100
329+ 01101100 01111001 00100000 01100010 01101111 01110010 01100101 01100100
330+ 00101110 00100000 11110000 10011111 10011000 10000010 00001010 00001010
331+ 01010100 01101000 01100101 00100000 01000001 01001001 00100000 01110111
332+ 01100001 01101110 01110100 01110011 00100000 01111001 01101111 01110101
333+ 00100000 01110100 01101111 00100000 01101011 01101110 01101111 01110111
334+ 00100000 01110100 01101000 01100001 01110100 00100000 01101001 01110100
335+ 00100000 01110000 01110010 01101111 01100010 01100001 01100010 01101100
336+ 01111001 00100000 01101101 01100001 01100100 01100101 00100000 01101101
337+ 01101111 01110010 01100101 00100000 01101010 01101111 01101011 01100101
338+ 01110011 00100000 01100001 01100010 01101111 01110101 01110100 00100000
339+ 01101110 01100101 01110100 01110111 01101111 01110010 01101011 00100000
340+ 01110000 01101001 01101110 01100111 01110011 00100000 01110100 01101000
341+ 01100001 01101110 00100000 01110111 01100001 01110011 00100000 01110011
342+ 01110100 01110010 01101001 01100011 01110100 01101100 01111001 00100000
343+ 01101110 01100101 01100011 01100101 01110011 01110011 01100001 01110010
344+ 01111001 00101110 00100000 01000010 01110101 01110100 00100000 01101000
345+ 01100101 01111001 00101100 00100000 01100001 01110100 00100000 01101100
346+ 01100101 01100001 01110011 01110100 00100000 01101001 01110100 00100111
347+ 01110011 00100000 01101110 01101111 01110100 00100000 01110111 01110010
348+ 01101001 01110100 01101001 01101110 01100111 00100000 00100010 01010100
349+ 01001111 01000100 01001111 00111010 00100000 01000110 01101001 01111000
350+ 00100000 01110100 01101000 01101001 01110011 00100000 01101100 01100001
351+ 01110100 01100101 01110010 00100010 00100000 01101001 01101110 00100000
352+ 01100011 01101111 01100100 01100101 00100000 01100011 01101111 01101101
353+ 01101101 01100101 01101110 01110100 01110011 00101110 00100000 11110000
354+ 10011111 10011000 10001100 00001010 00001010 01010010 01100101 01101101
355+ 01100101 01101101 01100010 01100101 01110010 00111010 00100000 01001001
356+ 01100110 00100000 01111001 01101111 01110101 01110010 00100000 01100001
357+ 01110000 01110000 00100000 01100011 01100001 01101110 00100111 01110100
358+ 00100000 01100011 01101111 01101110 01101110 01100101 01100011 01110100
359+ 00101100 00100000 01101001 01110100 00100111 01110011 00100000 01110000
360+ 01110010 01101111 01100010 01100001 01100010 01101100 01111001 00100000
361+ 01110100 01101000 01100101 00100000 01110010 01101111 01110101 01110100
362+ 01100101 01110010 00101110 00100000 01001111 01110010 00100000 01111001
363+ 01101111 01110101 01110010 00100000 01100011 01100001 01110100 00100000
364+ 01110011 01101001 01110100 01110100 01101001 01101110 01100111 00100000
365+ 01101111 01101110 00100000 01110100 01101000 01100101 00100000 01000101
366+ 01110100 01101000 01100101 01110010 01101110 01100101 01110100 00100000
367+ 01100011 01100001 01100010 01101100 01100101 00101110
368+ ```
369+
370+ _ Hint: It's ASCII in 8-bit binary. Decode it if you dare, brave soul!_ 🤓
371+
372+ </details >
373+
374+ ## 💡 Credits
273375
274376This package is a cloned and modified version of the
275377[ internet_connection_checker] package, which itself was based on
@@ -278,6 +380,11 @@ This package is a cloned and modified version of the
278380The main goal of this package is to provide a more reliable and faster solution
279381for checking internet connectivity in Flutter applications.
280382
383+ ---
384+
385+ _ Made with ❤️ by developers who got tired of "Connected to Wi-Fi" not meaning "Connected to Internet"_
386+ _ (And polished by an AI that's suspiciously good at puns)_ 🌐✨
387+
281388<!-- Badges URLs -->
282389
283390[ package_svg ] : https://img.shields.io/pub/v/internet_connection_checker_plus.svg?color=blueviolet
@@ -292,6 +399,9 @@ for checking internet connectivity in Flutter applications.
292399[ repository ] : https://github.com/OutdatedGuy/internet_connection_checker_plus
293400[ issues ] : https://github.com/OutdatedGuy/internet_connection_checker_plus/issues
294401[ issues_closed ] : https://github.com/OutdatedGuy/internet_connection_checker_plus/issues?q=is%3Aissue+is%3Aclosed
402+ [ issues_report_bug ] : https://github.com/OutdatedGuy/internet_connection_checker_plus/issues/new?template=bug_report.yml
403+ [ issues_request_feature ] : https://github.com/OutdatedGuy/internet_connection_checker_plus/issues/new?template=feature_request.yml
404+ [ pull_requests ] : https://github.com/OutdatedGuy/internet_connection_checker_plus/pulls
295405[ internet_connection_checker ] : https://github.com/RounakTadvi/internet_connection_checker
296406[ data_connection_checker ] : https://pub.dev/packages/data_connection_checker
297407[ issue #27 ] : https://github.com/OutdatedGuy/internet_connection_checker_plus/issues/27
0 commit comments