BelongsTo<E extends DataModel<E>> constructor

BelongsTo<E extends DataModel<E>>([
  1. E? model
])

Creates a BelongsTo relationship, with an optional initial E model.

Example:

final author = Author(name: 'JK Rowling');
final book = Book(id: 1, author: BelongsTo(author));

See also: DataModelRelationshipExtension<E>.asBelongsTo

Implementation

BelongsTo([final E? model]) : super(model != null ? {model} : null);