Check Internet Connection

Custom Code

I made a custom function to check the Internet connection:

import 'package:internet_connection_checker_plus/internet_connection_checker_plus.dart';

Future<bool> checkMyInternet() async {
  bool result = await InternetConnectionCheckerPlus().hasConnection;
  return result;
}

I created an "App Action Block" and included the above custom action. I am calling this "App action block" on each page. However, when the internet connection is lost, an error message appears, and the app redirects to the login page instead of the dedicated error page I set up. Could someone help me figure out what I might be doing wrong?

What have you tried so far?

Checked other posts

Did you check FlutterFlow's Documentation for this topic?
No
2
8 replies