Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kdy1/typed_firestore

Typed firstore for flutter
https://github.com/kdy1/typed_firestore

Last synced: 26 days ago
JSON representation

Typed firstore for flutter

Awesome Lists containing this project

README

        

# typed_firestore

Typed firestore entity.

## Usage

```dart

abstract class Car extends DocData implements Built {
static Serializer get serializer => _$carSerializer;

String get title;

@nullable
String get nullableField;

Car._();

factory Car([updates(CarBuilder b)]) = _$Car;
}

@SerializersFor(const [
Car,
])
Serializers serializers = _$serializers;

final firestore = new TypedFirestore(
Firestore.instance,
(serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build(),
);

final CollRef cars = firestore.collection('cars');

```