createPopoReport method
Creates a "popo" (police) report
Implementation
Future<String> createPopoReport(
String userId,
RaliPosition position, {
required String detectionType, // visual, radar, laser, etc.
String? radarType,
int? direction,
int? lane,
}) async {
try {
// Create the details map based on detection type
final details = <String, dynamic>{
'detectionType': detectionType,
};
// Add radar type if applicable
if (detectionType == 'radar' && radarType != null) {
details['radarType'] = radarType;
}
return await createUserReport(
userId,
'popo',
position,
details,
direction: direction,
lane: lane,
suggestedAlternative: 'warn', // Default for police reports
);
} catch (e) {
print('Error creating popo report: $e');
rethrow;
}
}