firestore_modeler 0.2.0+1 copy "firestore_modeler: ^0.2.0+1" to clipboard
firestore_modeler: ^0.2.0+1 copied to clipboard

A DevTools extension that provides a visual editor to generate Firestore type-safe clients.

Firestore Modeler #

A DevTools extension that generates type-safe Dart clients for Firestore.

Showcase

Installation #

  1. Add the package to your project:
dart pub add firestore_modeler
copied to clipboard

Setup #

1. Enable the extension in Dart DevTools To learn more about how about Flutter DevTools, read this article https://docs.flutter.dev/tools/devtools/extensions

2. Configure the project: Firestore Modeler will prompt you to create a configuration file (firestore_modeler.yaml). This file must be the project directory that has firestore_modeler listed as a dependency. > Note: DevTools may have issues with copy/paste operations when used within IDEs. For the initial setup, we recommend using Chrome DevTools instead.

3. Define your Firestore database schema using the visual editor

4. Generate the client code Click the "Generate" button in the bottom right corner A firestore_client.dart file will be created next to your firestore_modeler.yaml configuration file

Client Usage #

The client is generated using a modified version of cloud_firestore_odm.

// Create a collection reference
final rootCollection = [YourRootCollectionClass]CollectionReference();

final docRef = rootCollection.doc('id');

// You can access sub-collections from a document reference
final subCollection = docRef.mySubCollection;

// Typed CRUD operations
// The generator also generate necessary models
final MyModel data = await docRef.get();
await docRef.set(MyModel());
await docRef.update(MyModel());
await docRef.delete();

// Get a stream
collectionRef.snaphots()
docRef.snaphots()

// Query data
collectionRef.orderBy[Property]()
collectionRef.where[Property]()
collectionRef.limit()
collectionRef.select()
copied to clipboard

Useful Links #

For feature requests, please open an issue on Github Follow me on Twitter for development updates

3
likes
150
points
20
downloads
screenshot

Publisher

verified publisherpierremrtn.com

Weekly Downloads

2024.09.09 - 2025.03.24

A DevTools extension that provides a visual editor to generate Firestore type-safe clients.

Homepage
Repository (GitHub)

Topics

#firebase #firestore #odm #devtools #codegen

Documentation

API reference

License

MIT (license)

Dependencies

cloud_firestore_odm, flutter

More

Packages that depend on firestore_modeler