no_internet_check

Last updated:

0 purchases

no_internet_check Image
no_internet_check Images
Add to Cart

Description:

no internet check

This Code comes from https://gitlab.com/abnawaz14/no-internet-check *


no_internet_check #
A Flutter Package that depends on internet_connection_checker and flutter_toast. This package check the internet connectivity. If there is no internet, it show no internet screen. And if there is internet it will return you back to previous screen where you are.

Note that this plugin is just a test. you can fork it and make it better.

Quick start #
You can refer to example code.
add this line inside MaterialApp or if you are using your own key add that one.
navigatorKey: NavigationService.navigationKey,
copied to clipboard
call this method inside splash screen or inside your app first screen. if you are using await inside your main method. then you can also paste this code inside your main method.
if you are using your own key pass it inside constructor
InternetChecker(); //optional: you can pass custom no internet page as an argument
copied to clipboard
And You are done.
If you are using your own custom no internet page and you have pop() functionality. Then before poping the custom no internet page, add this line
IndexClass.index = 0;
copied to clipboard
if you are hitting autologin api inside splash screen
if you are using your own key pass it inside navigateTo() constructor
if (IndexClass.index == 0) { // there is internet
checkAutoLogin();
} else { // there is no internet
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
NavigationService.navigateTo().then((value) {
checkAutoLogin();
});
});
}
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.