get<R> method
Implementation
@override
Future<Response<T>> get<R>(
String id, {
Map<String, dynamic>? extra,
R? Function(R parent)? source,
}) async {
final response = Response<T>();
try {
final result = await _source(source).doc(id).get();
if (result.exists && result.data() != null) {
return response.copy(data: build(result.data()));
} else {
return response.copy(error: "Data not found!");
}
} catch (_) {
return response.copy(error: _.toString());
}
}