getLatest method Null safety
Get the latest result from the repository
Implementation
Future<T?> getLatest({
Query? query,
bool alwaysHydrate = false,
bool hydrateUnexisting = true,
bool requireRemote = false,
bool seedOnly = false,
}) async {
try {
final items = await get(
query: query,
alwaysHydrate: alwaysHydrate || !hydrated,
hydrateUnexisting: hydrateUnexisting,
requireRemote: requireRemote,
seedOnly: seedOnly,
);
return items != null && items.isNotEmpty ? items.last : null;
} on HttpException {
rethrow;
}
}