Skip to main content

passnote_generator 1.1.1 copy "passnote_generator: ^1.1.1" to clipboard
passnote_generator: ^1.1.1 copied to clipboard

Code generator for Passnote document models: one @Document annotation yields the codec, the document-id extractor, and the per-field CRDT schema.

example/passnote_generator_example.dart

// The annotated model below is the input; `dart run build_runner build`
// writes the codec, the id extractor, and the per-field CRDT schema into the
// part file. See the package README for the generated names.
//
// ```dart
// import 'package:passnote/passnote.dart';
//
// part 'todo.g.dart';
//
// @Document()
// class Todo {
//   Todo({required this.id, required this.title, this.votes = 0});
//
//   @DocumentId()
//   final String id;
//
//   final String title;
//
//   @Crdt(PnCounter())
//   final int votes;
// }
//
// final todos = database.collection<Todo>('todos', _$TodoCodec,
//     mergeStrategy: _$TodoMergeStrategy);
// ```
void main() {}
0
likes
140
points
232
downloads
screenshot

Documentation

API reference

Publisher

verified publishernodsoftware.net

Weekly Downloads

Code generator for Passnote document models: one @Document annotation yields the codec, the document-id extractor, and the per-field CRDT schema.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

analyzer, build, passnote, source_gen

More

Packages that depend on passnote_generator