showShareSheetForEntry function

void showShareSheetForEntry(
  1. BuildContext context,
  2. HttpLogEntry entry
)

Shows a bottom sheet with share options for a single entry.

Implementation

void showShareSheetForEntry(BuildContext context, HttpLogEntry entry) {
  _showSheet(context, [
    _Option(
      icon: Icons.terminal_rounded,
      label: 'Share as cURL',
      subtitle: 'curl -X ${entry.method} …',
      onTap: () => _share(_toCurl(entry), '${entry.method} ${entry.path}'),
    ),
    _Option(
      icon: Icons.article_outlined,
      label: 'Share Full Request + Response',
      subtitle: 'Human-readable text',
      onTap: () => _share(_toFullText(entry), '${entry.method} ${entry.path}'),
    ),
    _Option(
      icon: Icons.upload_rounded,
      label: 'Share Request Body',
      subtitle: entry.formattedRequestBody.isEmpty ? 'No body' : null,
      enabled: entry.formattedRequestBody.isNotEmpty,
      onTap: () => _share(entry.formattedRequestBody, 'Request Body'),
    ),
    _Option(
      icon: Icons.download_rounded,
      label: 'Share Response Body',
      subtitle: entry.formattedResponseBody.isEmpty ? 'No body' : null,
      enabled: entry.formattedResponseBody.isNotEmpty,
      onTap: () => _share(entry.formattedResponseBody, 'Response Body'),
    ),
  ]);
}