apiFailed function
Implementation
apiFailed(BuildContext? context) {
try {
return ScaffoldMessenger.of(context!).showSnackBar(
const SnackBar(
content: Text("Something is not right from API, Please try again!"),
duration: Duration(seconds: 2),
),
);
} catch (e) {
if (kDebugMode) {
print(e);
}
}
}