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

Firebase Analytics provider for analytics_hub. Sends LogEvent events to Firebase via the official SDK.

Analytics Hub Firebase Provider #

Dart Part of

Part of the analytics_hub workspace. New here? Start with the root README.

Ukrainian version: README.ua.md

analytics_hub_firebase connects analytics_hub to Firebase Analytics.

Current scope is log-only: this package maps LogEvent to FirebaseAnalytics.logEvent. It uses the core EventResolver contract with ResolvedEvent payload.

Installation #

dependencies:
  analytics_hub: ^0.5.0
  analytics_hub_firebase: ^0.5.0
  firebase_core: ^2.0.0
  firebase_analytics: ^10.0.0

Usage #

final hub = AnalyticsHub(
  providers: [
    FirebaseAnalyticsHubProvider.fromInstance(),
  ],
);

await hub.sendEvent(const SignupEvent('email'));

Event example:

class SignupEvent extends LogEvent {
  const SignupEvent(this.method) : super('sign_up');

  final String method;

  @override
  Map<String, Object?> get properties => {'method': method};

  @override
  List<EventProvider> get providers => const [
        EventProvider(FirebaseAnalyticsHubIdentifier()),
      ];
}

Notes #

  • User identification is managed by the app directly via FirebaseAnalytics.setUserId.
  • FirebaseAnalyticsEventResolver filters out null values from properties before calling logEvent.
  • Provider-specific event renaming/properties overrides are supported through EventProvider.overrides.
  • flush() is intentionally a no-op for Firebase Analytics (SDK has no explicit flush API).
0
likes
160
points
145
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Firebase Analytics provider for analytics_hub. Sends LogEvent events to Firebase via the official SDK.

Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

analytics_hub, firebase_analytics, firebase_core

More

Packages that depend on analytics_hub_firebase