hydrate<_Model extends OfflineFirstWithRestModel> method

  1. @protected
  2. @override
Future<List<_Model>> hydrate<_Model extends OfflineFirstWithRestModel>({
  1. bool deserializeSqlite = true,
  2. Query? query,
})

Fetch and store results from remoteProvider into SQLite and the memory cache.

deserializeSqlite loads data from SQLite after they've been inserted. Association queries can be expensive for large datasets, making deserialization a significant hit when the result is ignorable. Defaults to true.

Implementation

@protected
@override
Future<List<_Model>> hydrate<_Model extends OfflineFirstWithRestModel>({
  bool deserializeSqlite = true,
  Query? query,
}) async {
  try {
    return await super.hydrate(deserializeSqlite: deserializeSqlite, query: query);
  } on RestException catch (e) {
    logger.warning('#hydrate rest failure: $e');
  }

  return <_Model>[];
}