DataRepository class

Annotation on a DataModel model to request a Repository be generated for it.

Takes a list of adapters to be mixed into this Repository. Public methods of these adapters mixins will be made available in the repository via extensions.

A classic example is:

@JsonSerializable()
@DataRepository([JSONAPIAdapter])
class Todo with DataModel<Todo> {
  @override
  final int id;
  final String title;
  final bool completed;

  Todo({this.id, this.title, this.completed = false});
}

Constructors

DataRepository(List<Type> adapters, {bool remote = true})
const

Properties

adapters List<Type>
final
hashCode int
The hash code for this object.
no setterinherited
remote bool
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited