firestore_odm_builder 5.1.0
firestore_odm_builder: ^5.1.0 copied to clipboard
Code generator for firestore_odm, the type-safe Firestore ODM for Flutter and Dart. Generates typed queries, patches, aggregates and converters with build_runner.
example/example.md
Example #
Annotate models and a schema (see firestore_odm/example), then generate:
dart run build_runner build --delete-conflicting-outputs
The generated part gives each collection typed queries and updates:
final db = FirestoreODM(appSchema);
final adults = await db.users
.where(($) => $.age(isGreaterThanOrEqualTo: 18))
.orderBy(($) => ($.name(),))
.get();
await db.users('kim').patch(($) => [$.age.increment(1)]);
To migrate a cloud_firestore_odm project:
dart pub global run firestore_odm_builder:migrate --apply