UWebView constructor

const UWebView({
  1. required String initialUrl,
  2. Key? key,
  3. Map<String, String>? initialHeaders,
  4. Color? backgroundColor,
  5. OnUrlChanged? onUrlChanged,
  6. void onPageStarted(
    1. String url
    )?,
  7. void onPageFinished(
    1. String url
    )?,
  8. void onWebResourceError(
    1. WebResourceError error
    )?,
  9. void onWebViewCreated(
    1. WebViewController controller
    )?,
  10. bool onNavigationRequest(
    1. String url
    )?,
  11. bool showTopBar = false,
  12. bool showUrlBar = false,
  13. bool showBackButton = false,
  14. bool showForwardButton = false,
  15. bool showRefreshButton = false,
  16. bool showHomeButton = false,
  17. bool showProgressBar = false,
  18. bool showMoreMenu = false,
  19. bool showShareAction = false,
  20. bool showOpenInBrowserAction = false,
  21. bool showCopyLinkAction = false,
  22. bool showDesktopModeAction = false,
  23. bool showZoomActions = false,
  24. void onShareRequested(
    1. String url
    )?,
  25. void onOpenInBrowserRequested(
    1. String url
    )?,
  26. bool enableJavaScript = true,
  27. bool enablePinchZoom = false,
  28. bool enableJavaScriptDialogs = true,
  29. String? userAgent,
  30. 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",
  31. bool restrictToAllowedHosts = false,
  32. List<String> allowedHosts = const <String>[],
  33. Future<void> onPermissionRequest(
    1. WebViewPermissionRequest request
    )?,
  34. bool autoGrantMediaPermissions = true,
  35. Map<String, void Function(String message)>? javaScriptChannels,
  36. Widget errorBuilder(
    1. BuildContext context,
    2. String message,
    3. VoidCallback retry
    )?,
  37. 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,
});