flutter_estatisticas 0.0.10 copy "flutter_estatisticas: ^0.0.10" to clipboard
flutter_estatisticas: ^0.0.10 copied to clipboard

A Flutter package for integrating Umami Analytics into your apps. Track navigation and custom events easily, providing privacy-friendly analytics for your users.

Flutter Umami Analytics Integration #

This package integrates Umami Analytics into your Flutter app, allowing navigation tracking and custom event logging.

Installation #

Add to your pubspec.yaml:

dependencies:
  flutter_estatisticas: ^0.0.9

Usage #

1. Import the services #

import 'package:flutter_estatisticas/umami_service.dart';
import 'package:flutter_estatisticas/umami_navigation_observer.dart';

2. Instantiate the Umami service #

final umamiService = UmamiService(
  endpoint: 'https://michelmelo.pt',
  website: 'id-website', // Your Umami website ID
  hostname: 'seusite.com.pt', // Your app's hostname
);

3. Add the observer to your MaterialApp #

MaterialApp(
  // ... other parameters ...
  navigatorObservers: [
    UmamiNavigationObserver(umamiService),
  ],
)

4. Send custom events #

Simple click event

umamiService.enviarClique(context, 'spotify');

Replace 'spotify' with your desired event name.

Custom event

umamiService.enviarEvento(
  context,
  nome: 'event-name',
  dados: {
    'key': 'value',
    'foo': 'bar',
  },
);

Use enviarEvento to send events with additional data.


Notes #

  • The website parameter should be your site ID from the Umami dashboard.
  • The hostname should be your app's domain or identifier.
  • The observer will automatically track navigation events in your app.
  • Use enviarClique for simple events and enviarEvento for custom events with extra data.

License #

MIT

2
likes
0
points
129
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for integrating Umami Analytics into your apps. Track navigation and custom events easily, providing privacy-friendly analytics for your users.

Repository

License

unknown (license)

Dependencies

device_info_plus, flutter, http

More

Packages that depend on flutter_estatisticas