firebase_dart 0.7.14

  • Readme
  • Changelog
  • Installing
  • 55

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.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

Use this package as a library

1. Depend on it

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


dependencies:
  firebase_dart: ^0.7.14

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]
64
Health:
Code health derived from static analysis. [more]
15
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
55
Learn more about scoring.

We analyzed this package on Nov 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

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

Health suggestions

Fix lib/src/repo.dart. (-27.81 points)

Analysis of lib/src/repo.dart reported 65 hints, including:

line 19 col 17: Unnecessary new keyword.

line 29 col 35: Unnecessary new keyword.

line 33 col 38: Unnecessary new keyword.

line 37 col 41: Unnecessary new keyword.

line 37 col 57: Unnecessary new keyword.

Fix lib/src/synctree.dart. (-17.76 points)

Analysis of lib/src/synctree.dart reported 39 hints, including:

line 15 col 17: Unnecessary new keyword.

line 25 col 17: Unnecessary new keyword.

line 26 col 13: Unnecessary new keyword.

line 26 col 32: Unnecessary new keyword.

line 27 col 13: Unnecessary new keyword.

Fix lib/src/connections/protocol/connection.dart. (-12.22 points)

Analysis of lib/src/connections/protocol/connection.dart reported 26 hints, including:

line 13 col 7: Unnecessary new keyword.

line 27 col 7: Unnecessary new keyword.

line 34 col 15: Unnecessary new keyword.

line 38 col 13: Unnecessary new keyword.

line 39 col 16: Unnecessary new keyword.

Fix additional 24 files with analysis or formatting issues. (-116.43 points)

Additional issues in the following files:

  • lib/src/connections/protocol/message.dart (26 hints)
  • lib/src/operations/tree.dart (26 hints)
  • lib/src/connections/mem.dart (24 hints)
  • lib/src/connections/protocol/transport.dart (21 hints)
  • lib/src/treestructureddata/treestructureddata.dart (17 hints)
  • lib/src/treestructureddata/filter.dart (16 hints)
  • lib/src/connection.dart (14 hints)
  • lib/src/connections/protocol/request.dart (13 hints)
  • lib/src/firebase/token.dart (13 hints)
  • lib/src/firebase_impl.dart (13 hints)
  • lib/src/data_observer.dart (10 hints)
  • lib/src/treestructureddata/value.dart (10 hints)
  • lib/src/view.dart (10 hints)
  • lib/src/tree.dart (7 hints)
  • lib/src/treestructureddata/name.dart (5 hints)
  • lib/src/firebase/firebase.dart (4 hints)
  • lib/firebase_core.dart (3 hints)
  • lib/src/event.dart (2 hints)
  • lib/src/firebase/server_value.dart (2 hints)
  • lib/src/isolate_runner.dart (2 hints)
  • lib/src/connections/protocol.dart (1 hint)
  • lib/src/connections/protocol/websocket_html.dart (1 hint)
  • lib/src/connections/protocol/websocket_io.dart (1 hint)
  • lib/src/firebase/database.dart (1 hint)

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and firebase_dart.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.14.0 <3.0.0
async >=1.13.0 <3.0.0 2.4.0
collection ^1.9.1 1.14.12
convert ^2.0.0 2.1.1
crypto >=2.0.1 <3.0.0 2.1.3
dart2_constant ^1.0.0 1.0.2+dart2
isolate >=1.1.0 <3.0.0 2.0.2
logging >=0.11.0 <0.12.0 0.11.3+2
meta ^1.1.5 1.1.8
quiver >=0.22.0 <3.0.0 2.1.2+1
sortedmap ^0.4.1 0.4.2
web_socket_channel >=1.0.4 <2.0.0 1.1.0
Transitive dependencies
charcode 1.1.2
matcher 0.12.6
path 1.6.4
stack_trace 1.9.3
stream_channel 2.0.0
typed_data 1.1.6
Dev dependencies
test >=0.12.0 <2.0.0