FakeResponse.bytes constructor

const FakeResponse.bytes(
  1. List<int> bytes, {
  2. required String contentType,
  3. int status = 200,
  4. Map<String, String> headers = const {},
})

A response with the binary bytes of contentType (an image/* download such as getBrandingLogo, a file of downloadFile); the contract check sees no JSON body. status is 200 unless a range gives 206; headers adds ETag, Repr-Digest and the like.

Implementation

const FakeResponse.bytes(
  List<int> this.bytes, {
  required String this._contentType,
  this.status = 200,
  this.headers = const {},
}) : body = null;