webview_cef (linux webview) not works in other platforms

This commit is contained in:
DASHU
2025-05-01 21:21:01 +08:00
parent 78e0b83e16
commit 3d02ff8216
11 changed files with 458 additions and 477 deletions

View File

@@ -1,70 +1,70 @@
import 'package:webview_cef/webview_cef.dart';
// import 'package:webview_cef/webview_cef.dart';
import 'webview_controller_interface.dart';
// import 'webview_controller_interface.dart';
class WebviewLinuxController extends WebviewControllerInterface {
// class WebviewLinuxController extends WebviewControllerInterface {
WebViewController controller;
// WebViewController controller;
WebviewLinuxController(this.controller);
// WebviewLinuxController(this.controller);
@override
Future<void> reload() async {
await controller.reload();
}
// @override
// Future<void> reload() async {
// await controller.reload();
// }
@override
Future<void> goBack() async {
await controller.goBack();
}
// @override
// Future<void> goBack() async {
// await controller.goBack();
// }
@override
Future<bool> canGoBack() async {
return true;
}
// @override
// Future<bool> canGoBack() async {
// return true;
// }
@override
Future<void> goForward() async {
await controller.goForward();
}
// @override
// Future<void> goForward() async {
// await controller.goForward();
// }
@override
Future<Uri?> getUrl() async {
try {
if (url != null) {
return Uri.parse(url!);
}
} catch (e) {}
return null;
}
// @override
// Future<Uri?> getUrl() async {
// try {
// if (url != null) {
// return Uri.parse(url!);
// }
// } catch (e) {}
// return null;
// }
@override
Future<String?> getFavicon() async {
return null;
}
// @override
// Future<String?> getFavicon() async {
// return null;
// }
@override
Future<void> loadUrl(String url) async {
await controller.loadUrl(url);
}
// @override
// Future<void> loadUrl(String url) async {
// await controller.loadUrl(url);
// }
@override
Future<String?> getTitle() async {
return title;
}
// @override
// Future<String?> getTitle() async {
// return title;
// }
String? title;
// String? title;
String? url;
// String? url;
void setTitle(String title) {
title = title;
}
// void setTitle(String title) {
// title = title;
// }
void setUrl(String url) {
url = url;
}
// void setUrl(String url) {
// url = url;
// }
}
// }