contentsquare 4.1.0 copy "contentsquare: ^4.1.0" to clipboard
contentsquare: ^4.1.0 copied to clipboard

Contentsquare SDK for Flutter. Great digital experiences start with great digital insights.

example/example.md

Contentsquare Example #

Getting Started #

For full documentation, check out the Contentsquare Flutter SDK documentation.

Simple Usage Example #

Start the SDK in your main() function:

import 'package:contentsquare/csq.dart';
import 'package:flutter/material.dart';

void main() async {
  // Start Contentsquare SDK
  await CSQ().start();
  
  // Get user consent
  await CSQ().optIn();
  
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: const HomePage(),
    );
  }
}

class HomePage extends StatelessWidget {
  const HomePage({super.key});

  @override
  void initState() {
    super.initState();
    // Track screen view
    CSQ().trackScreenView('HomePage');
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Contentsquare Example'),
      ),
      body: const Center(
        child: Text('Screen views are tracked'),
      ),
    );
  }
}
11
likes
110
points
28.7k
downloads

Documentation

API reference

Publisher

verified publishercontentsquare.com

Weekly Downloads

Contentsquare SDK for Flutter. Great digital experiences start with great digital insights.

Homepage

License

unknown (license)

Dependencies

dart_flutter_version, equatable, fixnum_csq, flutter, heap_flutter_bridge, meta, protobuf_csq

More

Packages that depend on contentsquare

Packages that implement contentsquare