简体   繁体   English

在 Flutter 中打开 Web 视图并单击下拉列表时崩溃

[英]While Opening a web-view in Flutter and Click on Drop-Down list got Crash

[ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: 'package:flutter/src/widgets/page_view.dart': Failed assertion: line 179 pos 7: 'positions.isNotEmpty': PageController.page cannot be accessed before a PageView is built with it. [错误:flutter/lib/ui/ui_dart_state.cc(157)] 未处理的异常:'package:flutter/src/widgets/page_view.dart':断言失败:第 179 行位置 7:'positions.isNotEmpty':PageController.page在使用它构建 PageView 之前无法访问。

new WebView(
                initialUrl: webUrl,
                javascriptMode: JavascriptMode.unrestricted,
                onWebViewCreated: (controller) {
                  _myController = controller;
                },
                /*javascriptChannels: <JavascriptChannel>[
                  _toasterJavascriptChannel(context),
                ].toSet(),*/
                onPageFinished: (url) {
                  _myController.evaluateJavascript(
                      "console.log(document.documentElement.innerHTML);");

                  setState(() {
                    _loadedPage = true;
                  });
                },
              ),```
GestureDetector(
              child: WebviewScaffold(
                url: webUrl,
                withJavascript: true,
                withLocalStorage: true,
                persistentFooterButtons: <Widget>[
                  RaisedBtn(
                    onPressed: (){
                      waafiPaySpalshScreen();
                      flutterWebviewPlugin.dispose();
                    },
                    text: "Confirm",
                  )
                ],
              ),
            ),

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM