JS interface improvements

This commit is contained in:
Yegor Vialov
2020-02-12 22:42:43 +00:00
parent 6695756727
commit 6e448d3458
5 changed files with 16 additions and 13 deletions

View File

@ -41,9 +41,9 @@ class Launcher {
} else {
url += "?external_auth=1";
}
final flutterWebViewPlugin = new FlutterWebviewPlugin();
final flutterWebViewPlugin = new standaloneWebview.FlutterWebviewPlugin();
flutterWebViewPlugin.onStateChanged.listen((viewState) async {
if (viewState.type == WebViewState.startLoad) {
if (viewState.type == standaloneWebview.WebViewState.startLoad) {
Logger.d("[WebView] Injecting external auth JS");
rootBundle.loadString('assets/js/externalAuth.js').then((js){
flutterWebViewPlugin.evalJavascript(js.replaceFirst("[token]", ConnectionManager()._token));