Response.notModified constructor Null safety

  1. DateTime lastModified,
  2. CachePolicy? cachePolicy

Represents a 304 response.

Where lastModified is the last modified date of the resource and cachePolicy is the same policy as applied when this resource was first fetched.


Response.notModified(DateTime lastModified, CachePolicy? cachePolicy) {
  statusCode = HttpStatus.notModified;
  headers = {HttpHeaders.lastModifiedHeader: HttpDate.format(lastModified)};
  this.cachePolicy = cachePolicy;