firefast 0.1.6 copy "firefast: ^0.1.6" to clipboard
firefast: ^0.1.6 copied to clipboard

Firebase without the fuss. Define fields once, then just .write(), .read() Type-safe. Clean. Fast. Easy. Firestore, Realtime Database, Auth, Storage, Functions, Config and more!

img

Firebase without the fuss.

Define fields once, then just .write(), .read(), .delete().
Type-safe. Clean. Fast. Easy. No string keys. No casting. No boilerplate.

Supports: Firestore, Realtime Database (in progress)
Coming soon: Auth, Storage, Remote Config, App Check, Functions, and more.


๐Ÿ›  Roadmap #

  • โœ… Core Functionality
  • โœ… Firestore
  • โœ… Realtime Database
  • โŒ Documentation
  • โŒ Smart Caching
  • โŒ Rate Limits
  • โŒ Firebase Auth
  • โŒ Storage
  • โŒ Remote Config
  • โŒ App Check
  • โŒ Functions

Philosophy #

Firefast was built out of real-world frustration:

  • Constantly using string keys everywhere (prone to typos and errors).
  • Repeating serialization and parsing code again and again.
  • Handling different data types manually across Firestore, Realtime Database, and others.
  • Struggling to maintain clean separation of concerns.

Firefast solves this by letting you define fields once โ€” type-safe, clean, and automatic โ€” and then just call .write(), .read(), .delete() without worrying about anything else.
No more messy strings, no boilerplate serialization, no manual conversions.

You define your data model once โ€” the fields know how to serialize, deserialize, validate, adapt, and fetch themselves.

And that's it.


Why no await read() returning data? #

In Firefast, when you call:

await document.read();

it does not return anything.

Because everything was already defined beforehand โ€” what to read, how to adapt it, where to save it, how to validate it.
You don't need to "handle the result" manually.
It's clean. It's safe. It's scalable.


Fields First: Define Once, Use Everywhere #

You define fields using FireValue<T> objects โ€” strongly typed and automatically adapted to any database.

โœ… Native Dart types:
int, bool, double, String, DateTime, Uint8List, Map<String, dynamic>, etc.

โœ… Database Adaptation:
Bytes? Automatically become Firestore Blobs or encoded for Realtime DB.
DateTime? Automatically mapped as timestamps.
Maps? Automatically stored as JSON or object fields.

โœ… Events:
Define what happens when a new value is fetched โ€” once.

โœ… Guards (Optional):
Add permission checks, rate limits, or other conditions without touching your database logic.


Small Example: First Field #

final nameField = FireValue<String>(
  'name',
  toFire: user.name.toFire(),
  // fromFire:  optional
);

Now this field knows:

  • Its name ("name")
  • Its type (String)
  • How to pull the data locally when writing to the database
  • (Optionally) how to handle new data when reading from the database

You can define fields with only toFire, only fromFire, or both.

You can also easily use .toFire() on simple values without custom logic:

final ageField = FireValue<int>(
  'age',
  toFire: 30.toFire(), // send to fire
);

Or use full control if needed:

final backupField = FireValue<Uint8List>(
  'dataBackup',
  toFire: ToFire(generateBackup),    // send to fire
  fromFire: FromFire(restoreBackup), // get from fire
);

Node / Document: Build Once #

Now you link your fields to a document or a realtime node:

final userDoc = nameField.firestoreNewDoc("users", userId);

Or with multiple fields:

[nameField, ageField].firestoreNewDoc("users", userId);

Then, Just Use It #

Write:

await userDoc.write();

Read:

await userDoc.read();

Delete:

await userDoc.delete();

And you're done. No parameters. No strings. No casting. No parsing. All defined once.


Firefast is About #

  • Type safety โœ…
  • One-time field definition โœ…
  • Automatic adaptation to any database โœ…
  • Built-in event handling โœ…
  • Optional validation & permission guards โœ…
  • No runtime string keys, no runtime parsing โœ…
  • Clear separation between business logic and database operations โœ…

๐ŸŽฏ Why Firefast? #

โœ… Minimal Boilerplate โ€“ define once, reuse anywhere
โœ… Separation of Concerns โ€“ field logic lives in the field
โœ… Type Safety โ€“ avoid runtime errors and dynamic
โœ… Composable โ€“ easily construct documents, subcollections, fields
โœ… Scalable โ€“ works across all Firebase services (Firestore, RTDB, and more coming)
โœ… Clean API โ€“ no manual set(), get(), or Map<String, dynamic> juggling


๐Ÿ”ง Under the Hood #

  • Built on a modular path system (col().doc().withFields())
  • Abstracted data sources (FastDataPathSource) allow plug-and-play with Firestore, Realtime DB, Remote Config, etc.
  • Extensible caching system (FireCacheBox) with cooldowns and offline strategies (coming soon)

๐Ÿ“ฆ Installation #

dependencies:
  firefast: ^latest

Contribute #

Pull requests, feedback, and ideas are welcome!
Help shape a better Firebase developer experience.

โคด๏ธ Back -> Table of Contents

1
likes
140
points
661
downloads

Publisher

verified publisherjozz.biz

Weekly Downloads

Firebase without the fuss. Define fields once, then just .write(), .read() Type-safe. Clean. Fast. Easy. Firestore, Realtime Database, Auth, Storage, Functions, Config and more!

Repository (GitHub)
View/report issues

Topics

#firebase #firestore #realtime #database #auth

Documentation

API reference

License

MIT (license)

Dependencies

cloud_firestore, collection, firebase_database, firebase_remote_config, flutter, limit, prf

More

Packages that depend on firefast