firestore_odm_annotation 1.0.0 copy "firestore_odm_annotation: ^1.0.0" to clipboard
firestore_odm_annotation: ^1.0.0 copied to clipboard

Pure annotations for Firestore ODM code generation. Provides the core annotations used to generate type-safe Firestore ODM code.

Firestore ODM Annotation #

Pure annotations for Firestore ODM code generation. This package provides the core annotations used to generate type-safe Firestore ODM code.

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  firestore_odm_annotation: ^1.0.0

Usage #

This package provides annotations to mark your classes for Firestore ODM code generation:

import 'package:firestore_odm_annotation/firestore_odm_annotation.dart';

@Collection('users')
class User {
  const User({
    required this.name,
    required this.email,
  });

  final String name;
  final String email;
}

Available Annotations #

  • @Collection(path) - Marks a class as a Firestore collection
  • @SubCollection(path) - Marks a class as a Firestore subcollection
  • @DocumentId() - Marks a field as the document ID
  • @FirestoreField(name) - Maps a field to a different Firestore field name

Code Generation #

To generate the ODM code, you'll also need:

dev_dependencies:
  firestore_odm_builder: ^1.0.0
  build_runner: ^2.4.0

Then run:

dart run build_runner build

Features #

  • Type-safe Firestore operations
  • Automatic serialization/deserialization
  • Query builder support
  • Real-time updates
  • Subcollection support
0
likes
0
points
247
downloads

Publisher

verified publishersylphx.com

Weekly Downloads

Pure annotations for Firestore ODM code generation. Provides the core annotations used to generate type-safe Firestore ODM code.

Repository (GitHub)
View/report issues

Topics

#firestore #odm #annotations #code-generation #flutter

License

unknown (license)

Dependencies

meta

More

Packages that depend on firestore_odm_annotation