|
@@ -48,6 +48,15 @@ public class FlutterWebviewPlugin implements MethodCallHandler {
|
|
|
case "resize":
|
|
case "resize":
|
|
|
resize(call, result);
|
|
resize(call, result);
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case "reload":
|
|
|
|
|
+ reload(call, result);
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "back":
|
|
|
|
|
+ back(call, result);
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "forward":
|
|
|
|
|
+ forward(call, result);
|
|
|
|
|
+ break;
|
|
|
default:
|
|
default:
|
|
|
result.notImplemented();
|
|
result.notImplemented();
|
|
|
break;
|
|
break;
|
|
@@ -111,6 +120,31 @@ public class FlutterWebviewPlugin implements MethodCallHandler {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Navigates back on the Webview.
|
|
|
|
|
+ */
|
|
|
|
|
+ private void back(MethodCall call, MethodChannel.Result result) {
|
|
|
|
|
+ if (webViewManager != null) {
|
|
|
|
|
+ webViewManager.back(call, result);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Navigates forward on the Webview.
|
|
|
|
|
+ */
|
|
|
|
|
+ private void forward(MethodCall call, MethodChannel.Result result) {
|
|
|
|
|
+ if (webViewManager != null) {
|
|
|
|
|
+ webViewManager.forward(call, result);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Reloads the Webview.
|
|
|
|
|
+ */
|
|
|
|
|
+ private void reload(MethodCall call, MethodChannel.Result result) {
|
|
|
|
|
+ if (webViewManager != null) {
|
|
|
|
|
+ webViewManager.reload(call, result);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
private void eval(MethodCall call, final MethodChannel.Result result) {
|
|
private void eval(MethodCall call, final MethodChannel.Result result) {
|
|
|
if (webViewManager != null) {
|
|
if (webViewManager != null) {
|
|
|
webViewManager.eval(call, result);
|
|
webViewManager.eval(call, result);
|