ResponseBody.fromString constructor

ResponseBody.fromString(
  1. String text,
  2. int statusCode, {
  3. String? statusMessage,
  4. bool isRedirect = false,
  5. void onClose()?,
  6. Map<String, List<String>>? headers,
})

Implementation

ResponseBody.fromString(
  String text,
  this.statusCode, {
  this.statusMessage,
  this.isRedirect = false,
  void Function()? onClose,
  Map<String, List<String>>? headers,
})  : stream = Stream.value(Uint8List.fromList(utf8.encode(text))),
      headers = headers ?? {},
      _onClose = onClose;