UWebView constructor
const
UWebView({
- required String initialUrl,
- Key? key,
- Map<
String, String> ? initialHeaders, - Color? backgroundColor,
- OnUrlChanged? onUrlChanged,
- void onPageStarted(
- String url
- void onPageFinished(
- String url
- void onWebResourceError(
- WebResourceError error
- void onWebViewCreated(
- WebViewController controller
- bool showTopBar = false,
- bool showUrlBar = false,
- bool showBackButton = false,
- bool showForwardButton = false,
- bool showRefreshButton = false,
- bool showHomeButton = false,
- bool showProgressBar = false,
- bool showMoreMenu = false,
- bool showOpenInBrowserAction = false,
- bool showCopyLinkAction = false,
- bool showDesktopModeAction = false,
- bool showZoomActions = false,
- void onOpenInBrowserRequested(
- String url
- bool enableJavaScript = true,
- bool enablePinchZoom = false,
- bool enableJavaScriptDialogs = true,
- String? userAgent,
- String desktopUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 " "(KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
- bool restrictToAllowedHosts = false,
- List<
String> allowedHosts = const <String>[], - Future<
void> onPermissionRequest(- WebViewPermissionRequest request
- bool autoGrantMediaPermissions = true,
- Map<
String, void Function(String message)> ? javaScriptChannels, - Widget errorBuilder(
- BuildContext context,
- String message,
- VoidCallback retry
- Widget? loadingIndicator,
Implementation
const UWebView({
required this.initialUrl,
super.key,
this.initialHeaders,
this.backgroundColor,
this.onUrlChanged,
this.onPageStarted,
this.onPageFinished,
this.onWebResourceError,
this.onWebViewCreated,
this.onNavigationRequest,
this.showTopBar = false,
this.showUrlBar = false,
this.showBackButton = false,
this.showForwardButton = false,
this.showRefreshButton = false,
this.showHomeButton = false,
this.showProgressBar = false,
this.showMoreMenu = false,
this.showShareAction = false,
this.showOpenInBrowserAction = false,
this.showCopyLinkAction = false,
this.showDesktopModeAction = false,
this.showZoomActions = false,
this.onShareRequested,
this.onOpenInBrowserRequested,
this.enableJavaScript = true,
this.enablePinchZoom = false,
this.enableJavaScriptDialogs = true,
this.userAgent,
this.desktopUserAgent =
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
"(KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
this.restrictToAllowedHosts = false,
this.allowedHosts = const <String>[],
this.onPermissionRequest,
this.autoGrantMediaPermissions = true,
this.javaScriptChannels,
this.errorBuilder,
this.loadingIndicator,
});