tryCast<T> method
Attempts to cast the full document payload to a typed object.
Returns null if the full document is not present or conversion fails.
Implementation
T? tryCast<T>(T Function(JsonMap doc) fromJson) {
if (fullDocument == null) {
return null;
}
try {
return fromJson(fullDocument!);
} catch (_) {
return null;
}
}