flutter check internet access code example

Example 1: flutter check internet connection

import 'package:connectivity/connectivity.dart';

var connectivityResult = await (Connectivity().checkConnectivity());
if (connectivityResult == ConnectivityResult.mobile) {
  // I am connected to a mobile network.
} else if (connectivityResult == ConnectivityResult.wifi) {
  // I am connected to a wifi network.
}


//connectivity: any

Example 2: internet is not working in my release flutter

<uses-permission android:name="android.permission.INTERNET" />

Tags:

Misc Example