Skip to content
pubscout

firebase_dart

1.6.2, released 8 months ago by appsup.be

A pure Dart implementation of Firebase Authentication, Realtime Database, and Cloud Storage.

WASM-ready
$ flutter pub add firebase_dart
Source repository

What it does

Provides a pure Dart port of Firebase clients so you can access authentication, realtime database, and cloud storage across any platform including command line apps. It allows running database and auth logic in separate isolates or without an external emulator during unit tests.

AI-written summary of version 1.6.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need Firebase services in pure Dart environments like command-line apps.
  • You want to write unit tests for Firebase-dependent code without needing an external emulator.
  • You want to run Firebase operations in a separate isolate to keep the main thread smooth for rendering.

Skip it when

  • You need full official feature parity with native Firebase SDKs for every authentication provider or storage option.
  • You rely heavily on features explicitly marked as unsupported in the package documentation (e.g., popup/redirect auth flows).

Strengths

  • Pure Dart code works across all platforms, including command line and various desktop/mobile environments.
  • Built-in testing support allowing local setup without an external Firebase emulator.
  • Supports running the Firebase code in a separate isolate.

Weaknesses

  • Does not support all functionalities of the official Firebase authentication and storage services.
  • Query optimization features might occasionally conflict with very particular security rules.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
23

Initialize FirebaseDart with a storage path or use FirebaseDartFlutter.setup(), then initialize Firebase using your configuration options.

FirebaseDart.setup(storagePath: 'path/to/persistent/storage');
var app = await Firebase.initializeApp(
    options: FirebaseOptions.fromMap(json
        .decode(File('example/firebase-config.json').readAsStringSync())));

Alternatives

Packages that do the same job and could replace firebase_dart.

Works with

Packages commonly used together with firebase_dart: ones it builds on, ones built on it, and its own family.