getNetworkStatusWithAlert static method
void
getNetworkStatusWithAlert(
- dynamic callback(
- bool isOnline
- BuildContext context,
- Widget snackBarWidget,
- Color backgroundColor,
Implementation
static void getNetworkStatusWithAlert(Function(bool isOnline) callback,BuildContext context,Widget snackBarWidget,Color backgroundColor) {
NetworkConnectivity.isNetworkAvailable().then((value) {
callback.call(value);
if (!value) {
_showNoInternetSnackBar(context, snackBarWidget,backgroundColor);
} else {
ScaffoldMessenger.of(context).hideCurrentSnackBar();
}
});
}