heap_flutter_bridge 0.5.0 copy "heap_flutter_bridge: ^0.5.0" to clipboard
heap_flutter_bridge: ^0.5.0 copied to clipboard

Heap manual track SDK for Flutter apps on iOS, Android, and macOS.

example/example.md

Heap Flutter Bridge Example #

Getting Started #

For full documentation, installation instructions, and API reference, check out the Heap Flutter SDK documentation.

Simple Usage Example #

This example demonstrates the most common use cases of the Heap Flutter Bridge SDK:

Initialize the SDK #

Start by initializing Heap with your environment ID in the main() function:

import 'package:flutter/material.dart';
import 'package:heap_flutter_bridge/heap_flutter_bridge.dart';

void main() async {
  // Initialize Heap SDK with your environment ID
  await Heap().startRecording('YOUR_ENVIRONMENT_ID');

  runApp(const MyApp());
}

Track Custom Events #

Track events with optional properties:

void _incrementCounter() {
  setState(() {
    _counter++;
  });

  // Track custom event with properties
  Heap().track('button_clicked', {
    'counter_value': _counter,
    'screen': 'home',
  });
}

Identify Users #

Identify users and add user properties:

void _identifyUser() {
  // Identify the user with a unique ID
  Heap().identify('user_12345');

  // Add user properties
  Heap().addUserProperties({
    'subscription_tier': 'premium',
    'signup_date': '2024-01-01',
  });
}

Track Pageviews #

Manually track pageviews:

void _trackPageview() {
  // Track a pageview manually
  Heap().trackPageview(
    pageviewProperties: const PageviewProperties(
      title: 'Home Page',
    ),
  );
}
11
likes
120
points
6.9k
downloads

Documentation

API reference

Publisher

verified publishercontentsquare.com

Weekly Downloads

Heap manual track SDK for Flutter apps on iOS, Android, and macOS.

Homepage

License

unknown (license)

Dependencies

dart_flutter_version, equatable, flutter, plugin_platform_interface

More

Packages that depend on heap_flutter_bridge

Packages that implement heap_flutter_bridge