firebase_dart 0.7.15+4

  • Readme
  • Changelog
  • Example
  • Installing
  • 83

A pure Dart implementation of the Firebase client

Usage #

A simple usage example:

import 'package:firebase_dart/firebase_dart.dart';

main() {
  var ref = new Firebase("https://n6ufdauwqsdfmp.firebaseio-demo.com/");

  ref.child("test").onValue.listen((e) {
    print(e.snapshot.val);
  });
}

Local database #

Besides connecting to a remote firebase database, you can also create and work with a local in memory database.

var ref = new Firebase("mem://some.name/");

Features and bugs #

Please file feature requests and bugs at the issue tracker.

Changelog #

0.7.15 #

  • support more authentication methods: firebase secret, id token, access token
  • deprecate use of Firebase object, replaced by Reference object
  • dart sdk 2.5+ compatibility

0.7.14 #

  • fixed crash when receiving a merge in some situations

0.7.13 #

  • Now works with firebase emulators, e.g. new Firebase("http://localhost:9000?ns=my-project")

0.7.12 #

  • Fix recovering from broken connection and reset messages

0.7.11 #

  • Support Dart 2 in pubspec.yaml

0.7.10 #

  • Dart 2 pre-release compatibility

0.7.9 #

  • add FirebaseApp and FirebaseDatabase classes
  • performance improvements
  • recover from connection closed by peer

0.7.8 #

  • Remove dart 2 only things

0.7.7 #

  • Fix issue ack making view incomplete

0.7.6 #

  • Remove delay on write operations with in-memory database

0.7.5 #

  • Fix bug concurrent modification with transactions

0.7.4 #

  • Fix order by grandchild
  • Resolve strong mode analysis warnings

0.7.3 #

  • Fix The method 'operationForChild' was called on null.

0.7.2 #

  • Fix not able to authenticate with database secret

0.7.1 #

  • Fix bug saving lists

0.7.0 #

  • Local memory database
  • bugfixes

0.6.0 #

  • improved performance by only listening to the most general query
  • bugfixes

0.5.7 #

  • fix handling merge when some new children are nil

0.5.6 #

  • fix child of empty datasnapshot

0.5.5 #

  • implement onChildChanged, onChildMoved, onChildRemoved and onChildAdded

0.5.4 #

  • fix hash of null in transactions

0.5.3 #

  • fix signature check when padded

0.5.2 #

  • fix decoding tokens not padded with =

0.5.1 #

  • fix redirects to host with port

0.5.0 #

  • Breaking signature of startAt/endAt
  • reconnect when connection broken
  • bugfixes
  • FirebaseToken class

0.4.1 #

  • handle messages split in multiple frames (issue #8)

0.4.0 #

  • browser support
  • strong mode

0.3.0 #

  • implement transactions
  • implement onDisconnect
  • bug fixes

0.2.1 #

  • relax dependency on crypto library to '>=0.9.2 <3.0.0'

0.2.0 #

  • implement auth revoke and listen revoke
  • implement startAt and endAt
  • remove failed operations

0.1.0 #

  • Initial version

example/main.dart

import 'package:firebase_dart/firebase_dart.dart';

void main() {
  var ref = Firebase('https://n6ufdauwqsdfmp.firebaseio-demo.com/');

  ref.child('test').onValue.listen((e) {
    print(e.snapshot.val);
  });
}

Use this package as a library

1. Depend on it

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


dependencies:
  firebase_dart: ^0.7.15+4

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:firebase_dart/firebase_dart.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
68
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
83
Learn more about scoring.

We analyzed this package on Mar 31, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Health suggestions

Fix lib/src/firebase/database.dart. (-0.50 points)

Analysis of lib/src/firebase/database.dart reported 1 hint:

line 24 col 28: 'Firebase' is deprecated and shouldn't be used.

Fix lib/src/firebase/reference.dart. (-0.50 points)

Analysis of lib/src/firebase/reference.dart reported 1 hint:

line 7 col 36: 'Firebase' is deprecated and shouldn't be used.

Fix lib/src/firebase_impl.dart. (-0.50 points)

Analysis of lib/src/firebase_impl.dart reported 1 hint:

line 153 col 47: 'Firebase' is deprecated and shouldn't be used.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.5.0 <3.0.0
async >=1.13.0 <3.0.0 2.4.1
collection ^1.9.1 1.14.12
convert ^2.0.0 2.1.1
crypto >=2.0.1 <3.0.0 2.1.4
dart2_constant ^1.0.0 1.0.2+dart2
isolate >=1.1.0 <3.0.0 2.0.3
jose ^0.1.2 0.1.2+1
logging >=0.11.0 <0.12.0 0.11.4
meta ^1.1.5 1.1.8
quiver >=0.22.0 <3.0.0 2.1.3
sortedmap ^0.4.1 0.4.2+1
web_socket_channel >=1.0.4 <2.0.0 1.1.0
Transitive dependencies
built_collection 4.3.2
built_value 7.0.9
charcode 1.1.3
crypto_keys 0.1.0+2
fixnum 0.10.11
matcher 0.12.6
path 1.6.4
pointycastle 1.0.2
stack_trace 1.9.3
stream_channel 2.0.0
typed_data 1.1.6
Dev dependencies
pedantic ^1.9.0
test >=0.12.0 <2.0.0