showToast function

Future<bool?> showToast(
  1. dynamic jsonResponse
)

Displays a toast notification with the given message.

message - The message to display in the toast.

Returns a Future<bool?> that indicates whether the toast was successfully displayed.

Implementation

Future<bool?> showToast(jsonResponse) {
  return Fluttertoast.showToast(
      msg: jsonResponse['message'],
      toastLength: Toast.LENGTH_SHORT,
      gravity: ToastGravity.TOP,
      timeInSecForIosWeb: 1,
      backgroundColor: Colors.red,
      textColor: Colors.white,
      fontSize: 16.0);
}