Skip to content

Instantly share code, notes, and snippets.

@Classy-Bear
Last active December 8, 2019 06:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Classy-Bear/6d625325782d8fabb95399d709058784 to your computer and use it in GitHub Desktop.
Save Classy-Bear/6d625325782d8fabb95399d709058784 to your computer and use it in GitHub Desktop.
@override
void initState() {
super.initState();
connectivity = Connectivity();
subscription =
connectivity.onConnectivityChanged.listen((ConnectivityResult result) {
if (result == ConnectivityResult.wifi || result == ConnectivityResult.mobile) {
setState(() {});
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment