Response.movedPermanently(location, {body, Map<String, String> headers, Encoding encoding, Map<String, Object> context})

Constructs a 301 Moved Permanently response.

This indicates that the requested resource has moved permanently to a new URI. location is that URI; it can be either a String or a Uri. It's automatically set as the Location header in headers.

body is the response body. It may be either a String, a Stream>, or null to indicate no body. If it's a String, encoding is used to encode it to a Stream>. It defaults to UTF-8.

If encoding is passed, the "encoding" field of the Content-Type header in headers will be set appropriately. If there is no existing Content-Type header, it will be set to "application/octet-stream".

Source

Response.movedPermanently(location, {body, Map<String, String> headers,
    Encoding encoding, Map<String, Object> context})
    : this._redirect(301, location, body, headers, encoding,
        context: context);