openData method

Future<void> openData({
  1. required String data,
  2. String mimeType = "text/html",
  3. String encoding = "utf8",
  4. WebUri? baseUrl,
  5. @Deprecated("Use historyUrl instead") Uri? androidHistoryUrl,
  6. WebUri? historyUrl,
  7. @Deprecated('Use settings instead') InAppBrowserClassOptions? options,
  8. InAppBrowserClassSettings? settings,
})

Opens the PlatformInAppBrowser instance with data as a content, using baseUrl as the base URL for it.

The mimeType parameter specifies the format of the data. The default value is "text/html".

The encoding parameter specifies the encoding of the data. The default value is "utf8".

The androidHistoryUrl parameter is the URL to use as the history entry. The default value is about:blank. If non-null, this must be a valid URL. This parameter is used only on Android.

The options parameter specifies the options for the PlatformInAppBrowser.

settings: Settings for the PlatformInAppBrowser.

Officially Supported Platforms/Implementations:

  • Android native WebView
  • iOS
  • MacOS
  • Windows

Implementation

Future<void> openData(
    {required String data,
    String mimeType = "text/html",
    String encoding = "utf8",
    WebUri? baseUrl,
    @Deprecated("Use historyUrl instead") Uri? androidHistoryUrl,
    WebUri? historyUrl,
    @Deprecated('Use settings instead') InAppBrowserClassOptions? options,
    InAppBrowserClassSettings? settings}) {
  this.platform.eventHandler = this;
  return platform.openData(
      data: data,
      mimeType: mimeType,
      encoding: encoding,
      baseUrl: baseUrl,
      androidHistoryUrl: androidHistoryUrl,
      historyUrl: historyUrl,
      options: options,
      settings: settings);
}