DataRepository class

Annotation on a DataModelMixin 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, {List<Type> localAdapters = const [], bool remote = true, String? internalType, int? typeId, String? fromJson, String? toJson})
const

Properties

adapters List<Type>
final
fromJson String?
final
hashCode int
The hash code for this object.
no setterinherited
internalType String?
final
localAdapters List<Type>
final
remote bool
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
toJson String?
final
typeId int?
final

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