简体   繁体   中英

Flutter Chopper Internet connectivity

How in flutter project check internet connectivity and throw a page with text like "No internet" using Chopper only? without data_connection_checker or else

Chopper interacts with HTTP/HTTPS, whereas internet connectivity checking deals with lower levels of the IP stack .

You can technically try to make a request, and see if you get some kind of error, but that's not a reliable way. Often if there's no connection, the request will timeout, which could take a while. Even if you set a short timeout, it's much better to use a connectivity client.

The canonical plugin is connectivity_plus

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM