notFound static method

dynamic notFound()

Creates a Response for a request with a Not Found status.

Returns:

  • A Response with a 404 status code and a message indicating that the resource was not found.

Implementation

static notFound() {
  // Create a Response object with a status code of 404 (Not Found)
  return Response('{"error": "Not Found"}', 404,
      headers: {'Content-Type': 'application/json'});
}