userAgent property

String? userAgent
final

The value used for the HTTP User-Agent: request header.

When null the platform's webview default is used for the User-Agent header.

When the WebView is rebuilt with a different userAgent, the page reloads and the request uses the new User Agent.

When WebViewController.goBack is called after changing userAgent the previous userAgent value is used until the page is reloaded.

This field is ignored on iOS versions prior to 9 as the platform does not support a custom user agent.

By default userAgent is null.

Implementation

final String? userAgent;