problemResponse function

Received problemResponse(
  1. Problem problem
)

A non-2xx response whose body IS a problem envelope.

Implementation

Received problemResponse(Problem problem) => Received(
  HttpResponse(
    status: problem.status,
    headers: const <String, String>{'content-type': 'application/json'},
    body: jsonEncode(problem.toJson()),
  ),
);