Android devices detect captive portals requesting a specific URL , that currently is http://connectivitycheck.gstatic.com/generate_204. If they receive a 204 response then there’s connectivity. If they receive a 30x response, then there’s a captive portal in the way.
Read moreHow does flutter handle internet connection?
First, add it as a dependency in your pubspec. yaml file. Then, run flutter pub get to install the package.
Read more