pandino_client_sdk 0.1.7
pandino_client_sdk: ^0.1.7 copied to clipboard
Flutter SDK for Pandino event-based email marketing automation.
example/example.dart
import 'package:pandino_client_sdk/pandino_client_sdk.dart';
void main() async {
// Initialize the SDK
final sdk = await PandinoClientSDK.create(
publicKey: 'pk_7b127f5ab4661da5b08de719e27c001f');
await sdk.identify("user_id");
await sdk.updateUser(
{'name': "test", 'email': "test@sinaptik.ai", 'address': "....."});
await sdk.track(
eventName: 'button_click', properties: {'button_name': 'subscribe'});
// To use auto page view tracking
// Add route observer
final observers = <NavigatorObserver>[];
if (sdk.routeObserver != null) {
observers.add(sdksdk.routeObserver!);
}
// Add observers to navigator
return MaterialApp(
title: 'Test App',
navigatorObservers: observers,
theme: ThemeData(
primarySwatch: Colors.blue,
),
initialRoute: '/',
routes: {
'/first': (context) => FirstScreen(),
'/second': (context) => SecondScreen(),
},
);
// Clear session and identity on logout
await sdk.reset()
print('SDK operations completed.');
}