添加开发文档和使用手册

This commit is contained in:
Ferry-200
2024-09-21 15:05:56 +08:00
parent c3ca555eab
commit 5507d85142
3 changed files with 43 additions and 32 deletions

Binary file not shown.

View File

@@ -0,0 +1,7 @@
# [MaxKey APP客户端Flutter开发项目](https://summer-ospp.ac.cn/org/prodetail/24f420154?lang=zh&list=pro)
中间由于误操作使用了 Gitee 的强制同步远程仓库,提交记录被覆盖了。我通过 Gitee API 还原了部分提交记录,在 [changelog.md](./changelog.md)。
开发文档:[maxkey_flutter/README.md](./maxkey_flutter/README.md)
操作使用手册:[MaxKey APP 使用手册](./MaxKey-APP-user-guide.pdf)

View File

@@ -1,46 +1,50 @@
# maxkey_flutter
MaxKey Flutter project.
## [MaxKey APP 客户端 Flutter 开发项目](https://summer-ospp.ac.cn/org/prodetail/24f420154?lang=zh&list=pro)
### 待做:
### 功能
- [x] 账密登录
- [x] 手机号登录
- [x] 保留登录状态
- [x] 账号信息
- [x] 扫码登录
- [x] 登出
- [x] TOTP 录入
- [x] TOTP 展示
- [x] TOTP 录入、展示和编辑
- [x] TOTP 与账号绑定的持久化
- [x] 支持多个 TOTP
- [x] 检测 token 是否有效
- [x] 完善错误处理和提示
- [x] 优化用户界面
- [x] 多语言
- [x] 切换日夜间模式
- [x] 指定主机和测试链接
- [x] 查看日志
登录页:
- MaxKey LOGO
- 用户名、密码、验证码
- 登录
- 设置
### 编译帮助
1. 安装 Flutter 开发环境 [Install | Flutter](https://docs.flutter.dev/get-started/install)。本项目使用 Flutter 3.24.1
2. (可选)自定义主机地址。在 `[lib/persistent.dart](lib/persistent.dart)` 中修改 `MaxKeyPersistent``_DEFAULT_HOST`
3. 终端运行命令:
1. 获取依赖库:`flutter pub get`
2. 生成多语言文件:`flutter gen-l10n`
3. 构建 Release(Android)`flutter build apk`。详见 [Build and release an Android app](https://docs.flutter.dev/deployment/android)
4. 构建 Release(iOS)。详见 [Build and release an iOS app](https://docs.flutter.dev/deployment/ios)
主页面:
- 用户卡片(包括扫码登录按钮)
- 添加 TOTP 按钮
- TOTP 列表(可删除某个 TOTP
### 使用到的 Package
dio: 网络请求
go_router: 路由管理
mobile_scanner: 扫码
shared_preferences: 持久化
auth_totp: TOTP
logger: 日志
账号页:
- 用户卡片
- 详细信息
- 登出
- 设置
设置页:
- 主题模式(跟随系统、日间、夜间
- 地址、端口(提供请求 sign/get 以验证连接性的功能)
- 查看日志
持久化
- token
- host ip
- user's totp list
### 目录结构
- lib
- l10n // 多语言
- app_en.arb // 英语
- app_zh.arb // 中文
- maxkey // MaxKey API
- maxkey.dart // MaxKey API 单例
- services // MaxKey API参照 [maxkey-web-app/src/app/service](https://gitee.com/dromara/MaxKey/tree/main/maxkey-web-frontend/maxkey-web-app/src/app/service)
- pages // 页面
- app_color_scheme.dart // 从 MaxKey 图标生成的主题色
- main.dart
- persistent.dart // 持久化
- repeat_tween_animation_builder.dart // 动画组件
- totp.dart // TOTP 相关逻辑
- utils.dart // Logger, route path, str extension