ResponseBody.fromString constructor Null safety

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

Implementation

ResponseBody.fromString(
  String text,
  this.statusCode, {
  this.headers = const {},
  this.statusMessage,
  this.isRedirect = false,
}) : stream = Stream.fromIterable(
          utf8.encode(text).map((e) => Uint8List.fromList([e])).toList());