|
@@ -122,19 +122,25 @@ class WebviewManager {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Reloads the Webview.
|
|
|
|
|
+ */
|
|
|
void reload(MethodCall call, MethodChannel.Result result) {
|
|
void reload(MethodCall call, MethodChannel.Result result) {
|
|
|
if (webView != null) {
|
|
if (webView != null) {
|
|
|
webView.reload();
|
|
webView.reload();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Navigates back on the Webview.
|
|
|
|
|
+ */
|
|
|
void back(MethodCall call, MethodChannel.Result result) {
|
|
void back(MethodCall call, MethodChannel.Result result) {
|
|
|
if (webView != null && webView.canGoBack()) {
|
|
if (webView != null && webView.canGoBack()) {
|
|
|
webView.goBack();
|
|
webView.goBack();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Navigates forward on the Webview.
|
|
|
|
|
+ */
|
|
|
void forward(MethodCall call, MethodChannel.Result result) {
|
|
void forward(MethodCall call, MethodChannel.Result result) {
|
|
|
if (webView != null && webView.canGoForward()) {
|
|
if (webView != null && webView.canGoForward()) {
|
|
|
webView.goForward();
|
|
webView.goForward();
|
|
@@ -144,11 +150,15 @@ class WebviewManager {
|
|
|
void resize(FrameLayout.LayoutParams params) {
|
|
void resize(FrameLayout.LayoutParams params) {
|
|
|
webView.setLayoutParams(params);
|
|
webView.setLayoutParams(params);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Checks if going back on the Webview is possible.
|
|
|
|
|
+ */
|
|
|
boolean canGoBack() {
|
|
boolean canGoBack() {
|
|
|
return webView.canGoBack();
|
|
return webView.canGoBack();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Checks if going forward on the Webview is possible.
|
|
|
|
|
+ */
|
|
|
boolean canGoForward() {
|
|
boolean canGoForward() {
|
|
|
return webView.canGoForward();
|
|
return webView.canGoForward();
|
|
|
}
|
|
}
|