text method

String text()

Performs the text operation.

Implementation

String text() {
  final value = body;
  if (value == null) return '';
  if (value is String) return value;
  if (value is Uint8List) return utf8.decode(value);
  throw StateError('Cloudflare response body is not text-compatible.');
}