webview_flutter_tizen 0.12.0
webview_flutter_tizen: ^0.12.0 copied to clipboard
Tizen implementation of the webview_flutter plugin.
webview_flutter_tizen #
The Tizen implementation of webview_flutter for Tizen TV devices.
The WebView widget is backed by the device's native web engine, either EFL WebKit (EWK) or the newer WV API. See Web engine backend.
Required privileges #
To use this plugin, add below lines under the <manifest> section in your tizen-manifest.xml file.
<privileges>
<privilege>http://tizen.org/privilege/internet</privilege>
</privileges>
Usage #
This package is not an endorsed implementation of webview_flutter. Therefore, you have to include webview_flutter_tizen alongside webview_flutter as dependencies in your pubspec.yaml file.
dependencies:
webview_flutter: ^4.14.1
webview_flutter_tizen: ^0.12.0
Example #
import 'package:webview_flutter/webview_flutter.dart';
class WebViewExample extends StatefulWidget {
const WebViewExample({super.key});
@override
State<WebViewExample> createState() => _WebViewExampleState();
}
class _WebViewExampleState extends State<WebViewExample> {
final WebViewController _controller = WebViewController();
@override
void initState() {
super.initState();
_controller.loadRequest(Uri.parse('https://flutter.dev'));
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: WebViewWidget(controller: _controller),
);
}
}
Supported devices #
This plugin is only supported on Tizen TV devices running Tizen 5.5 or later.
Web engine backend #
The plugin chooses a backend from the platform version reported by the device:
| Tizen version | Backend |
|---|---|
| 10.0 and earlier | EFL WebKit (EWK) |
| 10.1 | WV API, EWK wrapper mode |
| 11.0 and later | WV API, standalone mode |
The WV backends are experimental. WebViewController.tizenEnginePolicy calls wv_set_version_policy() before WV engine initialization. The first WV view's setting applies to the engine for its lifetime.
Cookies #
WebViewCookieManager.getCookiescalls the EWK or WV cookie getter. On the EWK backend (Tizen 10.0 and earlier), the getter currently returns no cookies because of an engine defect.WebViewCookieManager.setCookieuses the WV cookie manager. EWK has no cookie setter, so it throwsUnimplementedErroron the EWK backend.- Cookie operations need a WebView that has been created, and fail before the first one is.
Note #
- To play Youtube, make app's background color to transparent.
--- a/packages/webview_flutter/example/lib/main.dart
+++ b/packages/webview_flutter/example/lib/main.dart
@override
Widget build(BuildContext context) {
return Scaffold(
- backgroundColor: Colors.green,
+ backgroundColor: Colors.transparent,
appBar: AppBar(
title: const Text('Flutter WebView example'),
- In Tizen 6.0, there were some devices that failed to create the web view. In this case, the creation failure is resolved by using the Upgrade Web Engine (UWE) internally. If you set the
WebViewController.tizenEnginePolicyextension API totruebefore creating theWebviewWidget, the webview will internally search for another version of the engine. However, this API can be changed(or removed) at any time and is not officially guaranteed to work.
import 'package:webview_flutter_tizen/webview_flutter_tizen.dart';
WebViewController _controller;
_controller.tizenEnginePolicy = true;
- The
setVerticalScrollBarEnabledandsetHorizontalScrollBarEnabledmethods are not independently controllable. Calling either method will affect both vertical and horizontal scrollbars simultaneously. If you need to hide scrollbars, call only one of these methods withfalse. Setting different values for each scrollbar (e.g., vertical enabled but horizontal disabled) is not supported. Note that these methods are currently not supported on TV devices. We are working on adding support in the near future.
// This will hide both vertical and horizontal scrollbars
await controller.setVerticalScrollBarEnabled(false);
// This will show both vertical and horizontal scrollbars
await controller.setHorizontalScrollBarEnabled(true);