fetch method

Future<T?> fetch()

Implementation

Future<T?> fetch() async {
  if (_isLoaded) {
    return _value;
  }
  final localKeyValue = _parent.toDatumMap()[localKey];
  if (localKeyValue == null) {
    return null;
  }
  final manager = getRelatedManager();
  final related = await manager.read(localKeyValue, userId: _parent.userId);
  _value = related;
  _isLoaded = true;
  return related;
}