Dart wrapper library for the new Firebase

Build Status

This is an unofficial Dart wrapper library for the new Firebase.

You can find more information on how to use Firebase on Getting started page.

Don't forget to setup correct rules for your realtime database and/or storage in Firebase console. Auth has to be also set in the Firebase console if you want to use it.

Usage

Installation

Install the library from the pub or Github.

Include Firebase source

You must include the original Firebase JavaScript source into your .html file to be able to use the library.

<script src="https://www.gstatic.com/firebasejs/3.3.0/firebase.js"></script>

Use it

import 'package:firebase3/firebase.dart' as firebase;

void main() {
  firebase.initializeApp(
    apiKey: "YourApiKey",
    authDomain: "YourAuthDomain",
    databaseURL: "YourDatabaseUrl",
    storageBucket: "YourStorageBucket");
    
  Database database = firebase.database();
  DatabaseReference ref = database.ref("messages");  

  ref.onValue.listen((e) {
    DataSnapshot datasnapshot = e.snapshot;
    //Do something with datasnapshot
  });
  
  ...
}

Examples

You can find more examples on realtime database, auth and storage in the example folder.

Bugs

This is the first version of the library, the bugs may appear. If you find a bug, please create an issue.

Libraries

firebase3

Firebase is a global namespace from which all the Firebase services are accessed.