apiFailed function

dynamic apiFailed(
  1. BuildContext? context
)

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);
    }
  }
}