flutter_reachability 1.0.0
flutter_reachability: ^1.0.0 copied to clipboard
This plugin allows Flutter applications to detect network changes. You can know the detailed mobile network types such as 2G, 3G, 4G, 5G. This plug-in is suitable for iOS and Android.
Use this package as a library
Depend on it
Run this command:
With Flutter:
$ flutter pub add flutter_reachability
copied to clipboard
This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get
):
dependencies:
flutter_reachability: ^1.0.0
copied to clipboard
Alternatively, your editor might support flutter pub get
. Check the docs for your editor to learn more.
Import it
Now in your Dart code, you can use:
import 'package:flutter_reachability/flutter_reachability.dart';
copied to clipboard