I build flutter app with just webview to show my website , i need to access to specific method in flutter app from javascript , Ex: to show some dialog in app .
Asked
Active
Viewed 137 times
-2

muhammad alshelleh
- 27
- 7
1 Answers
1
Depending on the WebViewExample plugin you're using, you'll need to use JavascriptChannel
.
You can find more here
UPDATE
Since the OP is using flutter_inappwebview, thiscontains all the information to use Javascript channels with the plugin.

magicleon94
- 4,887
- 2
- 24
- 53
-
i need to access from javascript to method wrote in flutter , like popup 'share' in whatsapp , facebook , or copy link .after click in button share in website in my app . – muhammad alshelleh Oct 13 '20 at 15:15
-
heh yes, via the JavascriptChannels you can call, from JS, methods written in dart – magicleon94 Oct 13 '20 at 15:16
-
Sorry, but is there any way with using InAppWebView . – muhammad alshelleh Oct 14 '20 at 12:15
-
1yup, check this out! https://github.com/pichillilorenzo/flutter_inappwebview/issues/370! There's an example too – magicleon94 Oct 14 '20 at 12:37
-
I have updated the answer with the link – magicleon94 Oct 14 '20 at 12:40