contentsquare 4.1.0
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'),
),
);
}
}