getById method

  1. @override
Future<ReadResult<T>> getById(
  1. ReadOperation<T> operation
)
override

Loads the instance of T whose primary key is found at ReadOperation.itemId.

Implementation

@override
Future<ReadResult<T>> getById(ReadOperation<T> operation) async {
  operation.details.assertEmpty('LocalSource<$T>.getById');
  return ReadSuccess<T>(
    await _itemsCache.read(operation.itemId),
    details: operation.details,
  );
}