TypedService
TypedService
// foo.dart
class Foo extends Model {
String bar;
Foo({this.bar});
}
// foo_service.dart
app.use('/foo', new TypedService<Foo>(new RethinkService(conn, r.table('foo')));
// blah_blah_blah.dart
Foo foo = await app.service('foo').create({'bar': 'baz'});
Foo otherFoo = await app.service('foo').create(new Foo(bar: 'quux'));Next Up...
Last updated