docs: optimize README
This commit is contained in:
95
README.md
95
README.md
@@ -1,17 +1,90 @@
|
||||
# mesh_drop_flutter
|
||||
# Mesh Drop
|
||||
|
||||
A new Flutter project.
|
||||
基于 `Flutter + Rust + flutter_rust_bridge` 的局域网传输应用,支持设备发现、文件/文件夹/文本发送与传输队列管理。
|
||||
|
||||
## Getting Started
|
||||
## 功能
|
||||
|
||||
This project is a starting point for a Flutter application.
|
||||
- 局域网设备发现与在线状态同步
|
||||
- 文件、文件夹、文本消息发送
|
||||
- 传输任务管理:接受/拒绝、取消、删除、清理完成项
|
||||
- 设备信任管理(Trust/Untrust)
|
||||
- TLS 开关、自动接收、历史记录与保存路径配置
|
||||
- 桌面端拖拽发送(Linux/macOS/Windows)
|
||||
|
||||
A few resources to get you started if this is your first Flutter project:
|
||||
## 技术栈
|
||||
|
||||
- [Learn Flutter](https://docs.flutter.dev/get-started/learn-flutter)
|
||||
- [Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
|
||||
- [Flutter learning resources](https://docs.flutter.dev/reference/learning-resources)
|
||||
- Flutter (`sdk: ^3.11.0`)
|
||||
- Riverpod
|
||||
- Rust (`tokio`/`axum`/`reqwest`)
|
||||
- flutter_rust_bridge (`2.11.1`)
|
||||
|
||||
For help getting started with Flutter development, view the
|
||||
[online documentation](https://docs.flutter.dev/), which offers tutorials,
|
||||
samples, guidance on mobile development, and a full API reference.
|
||||
## 快速开始
|
||||
|
||||
### 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 项目
|
||||
|
||||
Reference in New Issue
Block a user