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.
- Core Functionality
- Firestore
- Realtime Database
- Documentation
- Smart Caching
- Rate Limits
- Firebase Auth
- Storage
- Remote Config
- App Check
- Functions
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.
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.
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 Blob
s 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.
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
);
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);
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.
- 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 ✅
✅ 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
- 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)
dependencies:
firefast: ^latest
Pull requests, feedback, and ideas are welcome!
Help shape a better Firebase developer experience.