firebase_analytics 0.1.1

Firebase Analytics for Flutter

pub package

A Flutter plugin to use the Firebase Analytics API.

For Flutter plugins for other Firebase products, see FlutterFire.md.

Note: This plugin is still under development, and some APIs might not be available yet. Feedback and Pull Requests are most welcome!

Usage

To use this plugin, add firebase_analytics as a dependency in your pubspec.yaml file.

Track PageRoute Transitions

To track PageRoute transitions, add a FirebaseAnalyticsObserver to the list of NavigatorObservers on your Navigator, e.g. if you're using a MaterialApp:


FirebaseAnalytics analytics = new FirebaseAnalytics();

MaterialApp(
  home: new MyAppHome(),
  navigatorObservers: [
    new FirebaseAnalyticsObserver(analytics: analytics),
  ],
);

You can also track transitions within your PageRoute (e.g. when the user switches from one tab to another) by implementing RouteAware and subscribing it to FirebaseAnalyticsObserver. See examples/lib/tabs_page.dart for an example of how to wire that up.

Getting Started

See the example directory for a complete sample app using Firebase Analytics.

0.1.1

  • Change GMS dependency to 11.+

0.1.0+1

  • Aligned author name with rest of repo.

0.1.0

  • Added FirebaseAnalyticsObserver (a NavigatorObserver) to automatically log PageRoute transitions

0.0.5

  • Support for long parameter values on Android

0.0.4

  • Updated to Firebase SDK to always use latest patch version for 11.0.x builds

0.0.3

  • Updated to Firebase SDK Version 11.0.1

0.0.2

  • Bumped buildToolsVersion to 25.0.3
  • Updated README.md

0.0.1

  • Initial Release

1. Depend on it

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

dependencies:
  firebase_analytics: "^0.1.1"

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:firebase_analytics/firebase_analytics.dart';

Platforms

About

Firebase Analytics plugin for Flutter.

Author

Flutter Team

Homepage

github.com/flutter/plugins/tree/master/packages/firebase_analytics

Documentation

www.dartdocs.org/documentation/firebase_analytics/0.1.1/

Uploader

goderbauer@google.com
zarah@google.com
jackson@google.com

License

unknown (LICENSE)

Published

Oct 17, 2017