bloc_analytics 0.2.0

  • Readme.md
  • CHANGELOG.md
  • 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 #

tracker.logEvent(myEvent);

Tracking page view #

tracker.logPageView("page name");

Logging user properties #

Avaibles for : Firebase

tracker.setUserProperty(Constants.USER_PROPERTY_EMAIL, "example@gmail.com");

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.

example/main.dart

import 'package:bloc_analytics/bloc_analytics.dart';

class ExampleTracker implements Tracker {
  @override
  void logEvent(AnalyticsEvent event) {
    print(event);
  }

  @override
  void logPageView(String name) {
    print(name);
  }

  @override
  void setUserProperty(String key, Object any) {
    print(key);
  }
}

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

  tracker.logPageView('page');

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

Use this package as a library

1. Depend on it

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


dependencies:
  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
Popularity:
Describes how popular the package is relative to other packages. [more]
25
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
63
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

Platforms

Detected platforms: Flutter, web, other

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

Dependencies

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