st_crm 0.0.3 copy "st_crm: ^0.0.3" to clipboard
st_crm: ^0.0.3 copied to clipboard

A Flutter-ready CRM tool to manage notifications, in-app messages, email campaigns.

example/lib/main.dart

import 'package:st_crm/st_crm.dart';

void main() async {
  // Initialize CRM
  final crm = CRM(
    apiKey: 'your_api_key',
    endpoint: 'https://api.yourserver.com',
    debug: true,
  );

  // Wait for initialization
  await crm.initialize();

  // Identify user
  crm.identify('user123', traits: {
    'name': 'John Doe',
    'email': 'john@example.com',
    'plan': 'premium'
  });

  // Track custom event
  crm.trackEvent('button_clicked', 'ui_interaction',
      properties: {'button_name': 'checkout', 'screen': 'cart'});

  // Track custom attributes
  crm.trackCustomAttributes('preferred_language', 'english');
  crm.trackCustomAttributes('theme', 'dark');

  // Log purchase
  crm.logPurchase('premium_subscription', 'USD', 99.99, 1,
      properties: {'discount_applied': true, 'coupon_code': 'SUMMER2024'});

  // Update user traits
  crm.setUserTraits({
    'last_purchase_date': DateTime.now().toIso8601String(),
    'total_purchases': 5
  });

  // Send device token for push notifications
  try {
    await crm.sendDeviceToken('firebase_fcm_token_here');
  } catch (e) {
    print('Failed to send device token: $e');
  }

  // Wait a bit to let events process
  await Future.delayed(const Duration(seconds: 2));
}
0
likes
0
points
77
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter-ready CRM tool to manage notifications, in-app messages, email campaigns.

Homepage

License

unknown (license)

Dependencies

flutter, http, shared_preferences, uuid

More

Packages that depend on st_crm