Flutter WebView Integration

Last updated on

Introduction

A plugin to use Contentsquare in webview_flutter webviews.

This plugin supports Android and iOS.

This plugin exposes a custom implementation of the Webview tracking feature which tracks webview_flutter package webviews without having to implement the tracker again.

This package is not required to track these webviews but offers a convenient wrapper around the base ContentsquareWebViewTrackerBuilder class.

Get Started

This package relies on the Contentsquare Flutter plugin, and does not need any additional configuration.

To learn how to configure the Contentsquare plugin, see the documentation:

📚 Contentsquare Flutter documentation

Installation

Add the contentsquare_webview_flutter package in your pubspec.yaml:

dependencies:
  flutter:
    sdk: flutter
 
  contentsquare_webview_flutter: ^2.1.0

then run

flutter pub get

Usage

final _webViewController = WebViewController();
[...]
ContentsquareWebViewFlutterTrackerBuilder(
  webViewController: _webViewController,
  onTrackingReady: () => _webViewController.loadRequest(Uri.parse(url)),
  child: WebViewWidget(controller: _webViewController),
)

Compatibility

Each version of the Contentsquare Webview Flutter plugin is related to a version of the third party plugin webview_flutter. In order to make that clear, here is a compatibility table to consider when choosing your version of the plugin.

Contentsquare WebView Flutter Versionwebview_flutter VersionContentsquare Flutter Plugin Version
2.1.0^4.0.0^2.3.0
2.0.0^4.0.0^2.0.0
1.0.0^3.0.0^1.3.2

Changelog

📚 Flutter plugin SDK Changelog

📚 Contentsquare Flutter documentation