Backlink class Null safety

Backlink annotation specifies a link in a reverse direction of another relation.

This works as an "updatable view" of the original relation, and doesn't cause any more data to be stored in the database. Changes made to the backlink relation are reflected in the original direction.

Example - backlink based on a ToOne relation:

class Order {
  final customer = ToOne<Customer>();
class Customer {
  final orders = ToMany<Customer>();

Example - backlink based on a ToMany relation:

class Student {
  final teachers = ToMany<Teacher>();
class Teacher {
  final students = ToMany<Student>();


If there are multiple relations pointing to the current entity, specify the field name of the desired source relation: Backlink('sourceField').


hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
to String
Target entity to which this backlink points. It's the entity that contains a ToOne or ToMany relation pointing to the current entity.


noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
toString() String
A string representation of this object. [...]


operator ==(Object other) bool
The equality operator. [...]