ModelRefBase<T> class

Class for defining relationships between models.

You can have that relationship as data by passing a query for the related document to modelQuery.

Since it is a mutable class and has an interface to DocumentBase, it can be replaced by DocumentBase by implementing ModelRefBase and mixing in ModelRefMixin.

モデル間のリレーションを定義するためのクラス。

modelQueryに関連するドキュメントのクエリーを渡すことでそのリレーションをデータとして持つことができます。

ミュータブルクラスでかつDocumentBaseのインターフェースを備えているためModelRefBaseを実装し、ModelRefMixinをミックスインすることでDocumentBaseで置き換えることが可能です。

Inheritance
Implemented types

Constructors

ModelRefBase(DocumentModelQuery modelQuery)
Class for defining relationships between models.
const
ModelRefBase.fromJson(Map<String, dynamic> json)
Convert from json map to ModelRefBase.
factory
ModelRefBase.fromPath(String path, [ModelAdapter? adapter])
Class for defining relationships between models.
const
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
modelQuery DocumentModelQuery
DocumentModelQuery of the associated document.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
uid String
Returns the ID for the document path.
no setter
value → T?
Actual value.
no setteroverride

Methods

compareTo(ModelRefBase<T> other) int
Compares this object to another object.
override
delete() Future<void>
Data can be deleted.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
save(T? newValue) Future<void>
Data can be saved.
toJson() Map<String, dynamic>
Methods for Json serialization.
override
toString() String
A string representation of this object.
override

Operators

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

Constants

kRefKey → const String
Reference key.
kRefPathScheme → const String
Reference path scheme.
typeString → const String
Type key.