getRoutesSharedWith method
Gets routes shared with a specific user
Implementation
Future<List<RaliRoute>> getRoutesSharedWith(String userId) async {
try {
final querySnapshot = await _firestore
.collection(_collectionPath)
.where('sharedWith', arrayContains: userId)
.get();
return querySnapshot.docs.map((doc) =>
RaliRoute.fromMap(doc.data(), doc.id)
).toList();
} catch (e) {
print('Error getting shared routes: $e');
rethrow;
}
}