load<T extends Document<T>> method
Future<T?>
load<
T extends Document<T>>( - Document<T> document, {
- Source source = Source.serverAndCache,
- void fromCache(
- T?
)?,
})
override
Implementation
@override
Future<T?> load<T extends Document<T>>(
Document<T> document, {
Source source = Source.serverAndCache,
void Function(T?)? fromCache,
}) async {
if (fromCache != null) {
try {
final cache = await _load(document, Source.cache);
fromCache(cache != null ? cache as T : null);
} on Exception catch (_) {
fromCache(null);
}
}
final document0 = await _load(document, source);
return document0 != null ? document0 as T : null;
}