getErrorMessage static method

String? getErrorMessage(
  1. Map<String, dynamic> response
)

Gets the error message from an API response

@param response The API response as a map @return The error message or null if no error

Implementation

static String? getErrorMessage(Map<String, dynamic> response) {
  final String message = response['message'] ?? "";
  return message;
}