buildWebView method
- BuildMetadata meta,
- String url,
- {double height,
- double width}
Builds WebView.
Implementation
Widget buildWebView(
BuildMetadata meta,
String url, {
double height,
double width,
}) {
if (_widget?.webView != true) return buildWebViewLinkOnly(meta, url);
final dimensOk = height != null && height > 0 && width != null && width > 0;
return WebView(
url,
aspectRatio: dimensOk ? width / height : 16 / 9,
autoResize: !dimensOk && _widget.webViewJs == true,
interceptNavigationRequest: (newUrl) {
if (newUrl == url) return false;
gestureTapCallback(newUrl)();
return true;
},
js: _widget.webViewJs == true,
unsupportedWorkaroundForIssue37:
_widget.unsupportedWebViewWorkaroundForIssue37 == true,
);
}