shareFile static method
Creates a log file and hands it to the platform's share mechanism.
Platform-specific behavior:
- Native: opens the system share sheet via
onShare - Web: triggers a browser download (web has no native share sheet)
Parameters:
logs: The log content to sharefileName: Base name for the file (default: 'ispect_all_logs')onShare: Required on native, ignored on web
Implementation
static Future<void> shareFile(
String logs, {
String fileName = 'ispect_all_logs',
String fileType = 'json',
ISpectShareCallback? onShare,
}) async {
final handler = create();
await handler.createAndShareFile(
logs,
fileName: fileName,
fileType: fileType,
onShare: onShare,
);
}