contentsquare 4.1.3 copy "contentsquare: ^4.1.3" to clipboard
contentsquare: ^4.1.3 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
0
points
16k
downloads

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