deleteReport static method
Permanently removes a user's own report.
Deletes a social report created by the current user, removing it completely
from the map for all users. Only the original report creator has authority
to delete their reports. The operation executes asynchronously with result
delivered via onComplete callback.
Parameters
item: The social report OverlayItem to delete. Must be a valid social report overlay item created by the current user.onComplete: Callback invoked when operation completes or fails. Called with:- GemError.success when report is successfully deleted.
- GemError.invalidInput if
itemis not a social report overlay item or not from alarm notification. - GemError.accessDenied if user is not the report creator (only owner can delete their reports).
Returns
EventHandlerif operation was successfully initiated (use with cancel).nullif operation could not be started.
See also:
- denyReport - Provides negative feedback (available to all users).
- updateReport - Modifies report parameters (owner only).
- AlarmService - Provides notifications about incoming social reports.
Implementation
static EventHandler? deleteReport(
final OverlayItem item, {
final void Function(GemError error)? onComplete,
}) {
final EventDrivenProgressListener progListener =
EventDrivenProgressListener();
GemKitPlatform.instance.registerEventHandler(progListener.id, progListener);
progListener.registerOnCompleteWithData((final int err, _, _) {
GemKitPlatform.instance.unregisterEventHandler(progListener.id);
onComplete?.call(GemErrorExtension.fromCode(err));
});
final OperationResult result = staticMethod(
'SocialOverlay',
'deleteReport',
args: <String, dynamic>{
'item': item.pointerId,
'listener': progListener.id,
},
);
final GemError errorCode = GemErrorExtension.fromCode(result['result']);
if (errorCode != GemError.scheduled) {
GemKitPlatform.instance.unregisterEventHandler(progListener.id);
onComplete?.call(errorCode);
return null;
}
return progListener;
}