ResponseBody.fromBytes constructor

ResponseBody.fromBytes(
  1. List<int> bytes,
  2. int statusCode, {
  3. String? statusMessage,
  4. bool isRedirect = false,
  5. Map<String, List<String>>? headers,
})

Implementation

ResponseBody.fromBytes(
  List<int> bytes,
  this.statusCode, {
  this.statusMessage,
  this.isRedirect = false,
  Map<String, List<String>>? headers,
})  : stream = Stream.value(
        bytes is Uint8List ? bytes : Uint8List.fromList(bytes),
      ),
      headers = headers ?? {};