firebase_compute 0.1.2

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 4

firebase_compute

Build Status

Library for doing reactive computations with firebase.

Usage

A simple, yet powerful usage example!

Given a Firebase instance containing events in a calendar, the following code will print the next appointment.

import 'package:firebase_compute/firebase_compute.dart';
import 'package:firebase_dart/firebase_dart.dart';
import 'dart:async';

main() async {
  var ref = new Firebase("https://my-project.firebaseio.com");

  var data = new DynamicReference(ref); // create a reactive version of a firebase reference

  data
      .child("calendar").child("events")    // reference the subtree at /calendar/events
      .orderByChild("startTime").limitToFirst(1) // order by child startTime and limit to first result
      .startAt(new ReactiveDateTime.now().toIso8601String())  // start at the current time
      .firstChild() // move to the first child
      .val()
      .asStream().forEach((v)=>print("your next appointment is at ${v["startTime"]}: ${v["description"]}"));

  ref.child("calendar").child("events").push({
    "startTime": new DateTime.now().add(new Duration(hours: 4)).toIso8601String(),
    "description": "hairdresser"
  });  // will print "your next appointment is at ... : hairdresser"

  await new Future.delayed(new Duration(seconds: 2));

  ref.child("calendar").child("events").push({
    "startTime": new DateTime.now().add(new Duration(seconds: 10)).toIso8601String(),
    "description": "doctor"
  });  // will print "your next appointment is at ... : doctor"

  // after 10 seconds will print "your next appointment is at ... : hairdresser"



}

Features and bugs

Please file feature requests and bugs at the issue tracker.

Changelog

0.1.0

  • Initial version

Use this package as a library

1. Depend on it

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


dependencies:
  firebase_compute: ^0.1.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:firebase_compute/firebase_compute.dart';
  
Version Uploaded Documentation Archive
0.1.2 Dec 11, 2017 Go to the documentation of firebase_compute 0.1.2 Download firebase_compute 0.1.2 archive
0.1.1 Apr 11, 2017 Go to the documentation of firebase_compute 0.1.1 Download firebase_compute 0.1.1 archive
0.1.0 Mar 7, 2017 Go to the documentation of firebase_compute 0.1.0 Download firebase_compute 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
8
Health:
Code health derived from static analysis. [more]
--
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
--
Overall:
Weighted score of the above. [more]
4
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Maintenance issues and suggestions

Running dartdoc failed. (-10 points)

Make sure dartdoc runs without any issues.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.22.0 <2.0.0