1

I need to load a webview from dynamic URL in flutter web for that I am using webview_flutter: ^4.0.1.In sometimes I got ,

Error: UnimplementedError
    at Object.throw_ [as throw] (http://localhost:40977/dart_sdk.js:5080:11)
    at webview_flutter_web.WebWebViewPlatformController.new.updateSettings (http://localhost:40977/packages/webview_flutter_web/webview_flutter_web.dart.lib.js:171:17)
    at [_updateSettings] (http://localhost:40977/packages/webview_flutter/src/webview.dart.lib.js:696:48)
    at webview.WebViewController.__._updateWidget (http://localhost:40977/packages/webview_flutter/src/webview.dart.lib.js:689:36)
    at _updateWidget.next (<anonymous>)
    at runBody (http://localhost:40977/dart_sdk.js:40660:34)
    at Object._async [as async] (http://localhost:40977/dart_sdk.js:40691:7)
    at [_updateWidget] (http://localhost:40977/packages/webview_flutter/src/webview.dart.lib.js:687:20)
    at http://localhost:40977/packages/webview_flutter/src/webview.dart.lib.js:498:34
    at _RootZone.runUnary (http://localhost:40977/dart_sdk.js:40511:59)
    at _FutureListener.then.handleValue (http://localhost:40977/dart_sdk.js:35438:29)
    at handleValueCallback (http://localhost:40977/dart_sdk.js:35999:49)
    at _Future._propagateToListeners (http://localhost:40977/dart_sdk.js:36037:17)
    at async._AsyncCallbackEntry.new.callback (http://localhost:40977/dart_sdk.js:35753:27)
    at Object._microtaskLoop (http://localhost:40977/dart_sdk.js:40778:13)
    at _startMicrotaskLoop (http://localhost:40977/dart_sdk.js:40784:13)
    at http://localhost:40977/dart_sdk.js:36261:9

and sometimes it working without throw exception.

Below is the code I wrote for webview

WebViewController? wcontroller;
WebView(
  javascriptMode: JavascriptMode.unrestricted,
  onProgress: (pr) {
    Center(
      child: CircularProgressIndicator(),
    );
  },
  zoomEnabled: true,
  initialUrl: ''.toString(),
  onWebViewCreated: (WebViewController webViewController) async {
    wcontroller = webViewController;
    await wcontroller?.loadUrl(controller.getEventsListResponse2.value.data!.rows![controller.selectedIndex.value].eventUrl.toString());
  },
)
Ramji
  • 904
  • 2
  • 5
  • 20
Developer
  • 148
  • 8

0 Answers0