showMaterialDialog method
Implementation
void showMaterialDialog(BuildContext context) {
showDialog(
context: context,
builder: (BuildContext context) {
isAlertActive = true;
return AlertDialog(
title: Text('No Internet Connection'),
content: customNoInternetText ??
Text('Please check your internet connection and try again.'),
actions: [
TextButton(
onPressed: () {
isInternetBack(internetStatus: (status) {
if (status) {
isAlertActive = false;
Navigator.pop(context);
} else {
Navigator.pop(context);
Future.delayed(Duration(seconds: 1), () {
showPlatformAlert();
});
}
});
},
child: Text('Try Again'),
),
],
);
},
);
}