openBugReport static method

Future<void> openBugReport(
  1. BuildContext context, {
  2. ClarioDeskTheme? theme,
  3. ClarioDeskStrings? strings,
})

Open the bug-report form. An auto screenshot of the current screen is captured BEFORE the form is presented (so ClarioDesk's own UI is never in frame โ€” ยง4 B / D2); it shows as a removable preview tile on the form. Capture failures are silent โ€” the form still opens with no screenshot.

Implementation

static Future<void> openBugReport(
  BuildContext context, {
  ClarioDeskTheme? theme,
  ClarioDeskStrings? strings,
}) async {
  final shot = await _captureScreenshotAttachment();
  if (!context.mounted) {
    if (shot != null) await _deleteTempFile(shot.path);
    return;
  }
  try {
    await _present(context, CdRoutes.bugReport, theme, strings,
        bugScreenshot: shot);
  } finally {
    // The screenshot was uploaded (if submitted) before the surface
    // dismissed, so the temp file is safe to remove now โ€” on submit, on
    // user-remove, or on cancel. Best-effort; never throws.
    if (shot != null) await _deleteTempFile(shot.path);
  }
}