|
| 1 | +# flutter_inappwebview_tizen |
| 2 | + |
| 3 | +[](https://pub.dev/packages/flutter_inappwebview_tizen) |
| 4 | + |
| 5 | +The Tizen implementation of [`flutter_inappwebview`](https://pub.dev/packages/flutter_inappwebview). |
| 6 | + |
| 7 | +This package follows the same EWK-backed offscreen rendering approach as |
| 8 | +[`webview_flutter_tizen`](https://pub.dev/packages/webview_flutter_tizen) and |
| 9 | +maps it onto the `flutter_inappwebview` platform interface. Only the surface |
| 10 | +that maps cleanly onto the Tizen WebView (chromium-efl) is implemented; every |
| 11 | +other API raises `UnsupportedError` (or the `UnimplementedError` produced by |
| 12 | +the `flutter_inappwebview_platform_interface` defaults). |
| 13 | + |
| 14 | +## Required privileges |
| 15 | + |
| 16 | +Add the internet privilege to the app manifest: |
| 17 | + |
| 18 | +```xml |
| 19 | +<privileges> |
| 20 | + <privilege>http://tizen.org/privilege/internet</privilege> |
| 21 | +</privileges> |
| 22 | +``` |
| 23 | + |
| 24 | +## Usage |
| 25 | + |
| 26 | +```yaml |
| 27 | +dependencies: |
| 28 | + flutter_inappwebview: ^6.1.5 |
| 29 | + flutter_inappwebview_tizen: |
| 30 | + path: ../flutter_inappwebview_tizen |
| 31 | +``` |
| 32 | +
|
| 33 | +```dart |
| 34 | +import 'package:flutter/material.dart'; |
| 35 | +import 'package:flutter_inappwebview/flutter_inappwebview.dart'; |
| 36 | + |
| 37 | +class WebViewExample extends StatelessWidget { |
| 38 | + const WebViewExample({super.key}); |
| 39 | + |
| 40 | + @override |
| 41 | + Widget build(BuildContext context) { |
| 42 | + return Scaffold( |
| 43 | + body: InAppWebView( |
| 44 | + initialUrlRequest: URLRequest(url: WebUri('https://flutter.dev')), |
| 45 | + initialSettings: InAppWebViewSettings( |
| 46 | + javaScriptEnabled: true, |
| 47 | + useShouldOverrideUrlLoading: true, |
| 48 | + ), |
| 49 | + ), |
| 50 | + ); |
| 51 | + } |
| 52 | +} |
| 53 | +``` |
| 54 | + |
| 55 | +## Note |
| 56 | + |
| 57 | +- To play Youtube(video player), make app's background color to transparent. |
| 58 | + |
| 59 | +```diff |
| 60 | +--- a/packages/flutter_inappwebview/example/lib/in_app_webiew_example.screen.dart |
| 61 | ++++ b/packages/flutter_inappwebview/example/lib/in_app_webiew_example.screen.dart |
| 62 | +@@ -105,14 +105,13 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> { |
| 63 | + Widget build(BuildContext context) { |
| 64 | + return Scaffold( |
| 65 | + appBar: AppBar(title: Text("InAppWebView")), |
| 66 | ++ backgroundColor: Colors.transparent, |
| 67 | + drawer: myDrawer(context: context), |
| 68 | +``` |
| 69 | + |
| 70 | +## Supported |
| 71 | + |
| 72 | +- `InAppWebView` platform view |
| 73 | +- URL/file/data loading, back/forward/reload/stop, post requests |
| 74 | +- JavaScript evaluation |
| 75 | +- Navigation interception via `shouldOverrideUrlLoading` |
| 76 | +- `onLoadStart`, `onLoadStop`, `onReceivedError`, `onProgressChanged`, |
| 77 | + `onTitleChanged`, `onConsoleMessage`, `onScrollChanged`, |
| 78 | + `onZoomScaleChanged`, `onUpdateVisitedHistory`, and JavaScript dialog |
| 79 | + callbacks (`onJsAlert`, `onJsConfirm`, `onJsPrompt`) |
| 80 | +- A subset of `InAppWebViewSettings`: `javaScriptEnabled`, `supportZoom`, |
| 81 | + `userAgent`, `transparentBackground`, and `useShouldOverrideUrlLoading` |
| 82 | +- `clearCache`, `clearAllCache`, `getDefaultUserAgent`, `handlesURLScheme` |
| 83 | +- `CookieManager.deleteAllCookies()` |
| 84 | + |
| 85 | +`InAppWebViewController.getDefaultUserAgent()` returns the EWK user agent that |
| 86 | +was captured the first time an `InAppWebView` was created in the process; the |
| 87 | +value is cached so it remains available after every webview is disposed. |
| 88 | +Calling it before any `InAppWebView` has been created returns an empty string. |
| 89 | + |
| 90 | +## Not supported |
| 91 | + |
| 92 | +The following capabilities are intentionally out of scope and raise |
| 93 | +`UnsupportedError`/`UnimplementedError` when invoked: |
| 94 | + |
| 95 | +- `InAppBrowser`, `HeadlessInAppWebView`, `ChromeSafariBrowser` |
| 96 | +- `InAppWebViewKeepAlive`, popup `windowId`, context menus, pull-to-refresh |
| 97 | +- `FindInteractionController`, `PrintJobController`, `WebMessage*`, |
| 98 | + `WebStorage*`, `WebViewEnvironment`, `HttpAuthCredentialDatabase` |
| 99 | +- JavaScript handlers/channels and user script injection |
| 100 | +- Per-cookie mutation/query APIs (`setCookie`, `getCookie(s)`, |
| 101 | + `deleteCookie(s)`) |
| 102 | +- Resource interception, custom-scheme loading, downloads, permission and |
| 103 | + geolocation prompts, render-process events, fullscreen, capture state, |
| 104 | + content-size, and other callbacks not listed above |
| 105 | +- Multi-step `goBackOrForward`/`canGoBackOrForward`/`goTo`, `isLoading`, |
| 106 | + `getOriginalUrl`, `getSettings`, `reloadFromOrigin`, `pause`/`resume` |
| 107 | +- DevTools, simulated requests, screenshot/PDF/web-archive capture, JS/CSS |
| 108 | + injection, service worker / proxy / tracing / path-handler controllers |
0 commit comments