Flutter Check whether there is an Internet connection available or not
first install this package connectivity
Run this command:
With Flutter:
$ flutter pub add connectivity
Import it
Now in your Dart code, you can use:
import 'package:connectivity/connectivity.dart';