Home > Enterprise >  How to use Flutter's WebView to show graphs or charts (e.g. through D3.js or Chart.js) on Flutt
How to use Flutter's WebView to show graphs or charts (e.g. through D3.js or Chart.js) on Flutt

Time:11-25

This is a follow-up to Flutter inappwebview web example

CodePudding user response:

Are you trying to make an android application with flutter(dart) that support webview?

  1. run

    flutter clean, flutter pub get

  2. Have you Explored the parameter that can be used by flutter webview package?

To check what parameters that available, you can press ctrl left click button on the webview class that imported from that flutter package.

     const WebView({
    Key? key,
    this.onWebViewCreated,
    this.initialUrl,
    this.initialCookies = const <WebViewCookie>[],
    this.javascriptMode = JavascriptMode.disabled,
    this.javascriptChannels,
    this.navigationDelegate,
    this.gestureRecognizers,
    this.onPageStarted,
    this.onPageFinished,
    this.onProgress,
    this.onWebResourceError,
    this.debuggingEnabled = false,
    this.gestureNavigationEnabled = false,
    this.userAgent,
    this.zoomEnabled = true,
    this.initialMediaPlaybackPolicy =
        AutoMediaPlaybackPolicy.require_user_action_for_all_media_types,
    this.allowsInlineMediaPlayback = false,
    this.backgroundColor,
  })  : assert(javascriptMode != null),
        assert(initialMediaPlaybackPolicy != null),
        assert(allowsInlineMediaPlayback != null),
        super(key: key);

the default is javascriptMode disabled, you may have to do trial and error until the webview works. Let me know if you still face the error

  • Related