shareLogs static method

Future<void> shareLogs()

分享日志文件(使用系统分享功能) 需要添加 share_plus 依赖

Implementation

static Future<void> shareLogs() async {
  try {
    final exportPath = await exportLogs();
    if (exportPath != null) {
      debugPrint('[DKLog] 日志文件已准备,路径: $exportPath');
      debugPrint('[DKLog] 提示: 使用 share_plus 包来分享此文件');
      // 如果需要分享功能,可以添加 share_plus 依赖
      // await Share.shareXFiles([XFile(exportPath)], text: '应用日志');
    }
  } catch (e) {
    debugPrint('[DKLog] 分享日志失败: $e');
  }
}