getById method

  1. @override
Future<OutputType?> getById(
  1. Object id, {
  2. Options? options,
  3. CancelToken? cancelToken,
  4. void onReceiveProgress(
    1. int total,
    2. int finish
    )?,
  5. bool caching = false,
})
override

Implementation

@override
Future<OutputType?> getById(
  Object id, {
  Options? options,
  CancelToken? cancelToken,
  void Function(int total, int finish)? onReceiveProgress,
  bool caching = false,
}) async {
  final response = await super.getById(
    id,
    options: options,
    cancelToken: cancelToken,
    onReceiveProgress: onReceiveProgress,
  );
  if (response == null) return null;

  if (caching) dbSet.insertRow(response);
  rows.add(response);
  return response;
}