Files
mesh-drop-flutter/README.md
2026-03-06 00:56:03 +11:00

91 lines
2.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Mesh Drop
基于 `Flutter + Rust + flutter_rust_bridge` 的局域网传输应用,支持设备发现、文件/文件夹/文本发送与传输队列管理。
## 功能
- 局域网设备发现与在线状态同步
- 文件、文件夹、文本消息发送
- 传输任务管理:接受/拒绝、取消、删除、清理完成项
- 设备信任管理Trust/Untrust
- TLS 开关、自动接收、历史记录与保存路径配置
- 桌面端拖拽发送Linux/macOS/Windows
## 技术栈
- Flutter (`sdk: ^3.11.0`)
- Riverpod
- Rust (`tokio`/`axum`/`reqwest`)
- flutter_rust_bridge (`2.11.1`)
## 快速开始
### 1. 环境要求
- Flutter建议 `stable`,项目已包含 `.fvmrc`
- Rust toolchain`rustup`, `cargo`
- 对应平台的 Flutter 构建环境Android/iOS/Desktop
### 2. 安装依赖
```bash
flutter pub get
```
如果你使用 FVM
```bash
fvm flutter pub get
```
### 3. 运行
```bash
flutter run -d linux
```
你也可以替换成其他设备,例如:
```bash
flutter run -d windows
flutter run -d macos
flutter run -d android
```
## 常用开发命令
```bash
# Flutter 代码检查
flutter analyze
# Flutter 测试
flutter test
# Dart 代码生成Riverpod/Freezed
dart run build_runner build --delete-conflicting-outputs
# Rust 代码检查
cargo check --manifest-path rust/Cargo.toml
```
## 配置与数据
- 应用配置文件位于系统配置目录:`<config_dir>/mesh-drop/config.json`
- 默认保存目录为系统下载目录(无法获取时回退到系统临时目录)
- 首次运行会自动生成设备身份密钥和 TLS 自签名证书
## 目录结构
```text
lib/ Flutter UI 与状态管理
lib/backend/ FRB 生成的 Dart 绑定与模型
rust/ Rust 核心逻辑(发现、传输、配置、安全)
rust_builder/ Flutter 与 Rust 构建胶水层cargokit
```
## 开发说明
- Rust API 变更后,需要重新生成 FRB 绑定代码
- `lib/backend/*generated*``*.g.dart`/`*.freezed.dart` 文件为生成文件,请勿手改
- 首次构建会编译 Rust 依赖,耗时明显长于普通 Flutter 项目