bloc_analytics 0.2.0

  • Example
  • Installing
  • Versions
  • 63

Flutter Bloc Analytics #

Use multiple analytics and other trackers in your Application easily

Supported trackers: #

  • Firebase

Usages instructions #

Registering your trackers #

Firebase #

final firebaseTracker =  FirebaseAnalytics();

Registering multiple trackers #

MultipleTracker tracker =  MultipleTracker([firebase, crashlytics]);

Starting Tracking #

After all trackers are registered you can just use the multiple tracker to track all events at once

Tracking event #


Tracking page view #

tracker.logPageView("page name");

Logging user properties #

Avaibles for : Firebase

tracker.setUserProperty(Constants.USER_PROPERTY_EMAIL, "");

Creating custom tracker #

In oder to create a custom tracker you just need to implement the Tracker interface.

[0.0.X] - TODO: Add release date.

  • TODO: Initial release with Firebase support.


import 'package:bloc_analytics/bloc_analytics.dart';

class ExampleTracker implements Tracker {
  void logEvent(AnalyticsEvent event) {

  void logPageView(String name) {

  void setUserProperty(String key, Object any) {

void main() {
  final tracker = MultipleTracker([ExampleTracker()]);
      AnalyticsEvent(name: 'test', parameters: {'propertyName': 'value'}));


  tracker.setUserProperty('a property', 'value');

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  bloc_analytics: ^0.2.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:bloc_analytics/bloc_analytics.dart';
Version Uploaded Documentation Archive
0.2.0 Feb 8, 2019 Go to the documentation of bloc_analytics 0.2.0 Download bloc_analytics 0.2.0 archive
0.1.0 Feb 7, 2019 Go to the documentation of bloc_analytics 0.1.0 Download bloc_analytics 0.1.0 archive
0.0.3 Feb 7, 2019 Go to the documentation of bloc_analytics 0.0.3 Download bloc_analytics 0.0.3 archive
0.0.2 Feb 7, 2019 Go to the documentation of bloc_analytics 0.0.2 Download bloc_analytics 0.0.2 archive
0.0.1 Feb 6, 2019 Go to the documentation of bloc_analytics 0.0.1 Download bloc_analytics 0.0.1 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on May 22, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.1
  • pana: 0.12.16


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:bloc_analytics/bloc_analytics.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.28.0 <3.0.0
meta ^1.1.6 1.1.7
Dev dependencies
mockito ^4.0.0
test >=1.3.0 <2.0.0
test_coverage ^0.2.0