$getProperty method

  1. @override
$Value? $getProperty(
  1. Runtime runtime,
  2. String identifier
)

Get a property by identifier on this instance

Implementation

@override
$Value? $getProperty(Runtime runtime, String identifier) {
  switch (identifier) {
    case 'request':
      final _request = $value.request;
      return _request == null ? const $null() : $BaseRequest.wrap(_request);

    case 'statusCode':
      return $int($value.statusCode);

    case 'reasonPhrase':
      final _reasonPhrase = $value.reasonPhrase;
      return _reasonPhrase == null ? const $null() : $String(_reasonPhrase);

    case 'contentLength':
      final _contentLength = $value.contentLength;
      return _contentLength == null ? const $null() : $int(_contentLength);

    case 'headers':
      return $Map.wrap($value.headers);

    case 'isRedirect':
      return $bool($value.isRedirect);

    case 'persistentConnection':
      return $bool($value.persistentConnection);
  }
  return _superclass.$getProperty(runtime, identifier);
}