Get started

This plugin relies on the Contentsquare native SDKs to log events. It exposes a unified surface.
For more information, refer to the dedicated SDK docs:

📚 Android documentation

📚 iOS documentation

Add the contentsquare package in your pubspec.yaml:

pubspec.yaml
dependencies:
flutter:
sdk: flutter
contentsquare: ^3.7.0

then run

Terminal window
flutter pub get

To ensure optimal compatibility, make sure you respect the iOS compatibility documentation.

The plugin works out of the box.

You do not need to do anything to start the SDK. Now that the SDK is a dependency of your app, it will autostart itself when your application starts.

Look at the native SDK docs for validation on each platform.

Note that iOS logs should be viewed through Console or Xcode.

Wrap the entire application inside the ContentsquareRoot widget:

main.dart
import 'package:flutter/material.dart';
import 'package:contentsquare/contentsquare.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ContentsquareRoot( // <-- Wrap the entire app inside the ContentsquareRoot widget imported from 'package:contentsquare/contentsquare.dart'
child: MaterialApp(
title: 'My Flutter App',
home: Home()
),
);
}
}