getSubDocOnce method
Implementation
Future<DataSnapshot?> getSubDocOnce(String path, String subDocId) async {
try {
final snapshot = await _dbRef.child('$path/$subDocId').get();
if (snapshot.exists) {
print('Subdocument retrieved from $path/$subDocId: ${snapshot.value}');
} else {
print('No subdocument available at $path/$subDocId');
}
return snapshot;
} catch (e) {
print('Error getting subdocument: $e');
return null;
}
}